Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Jun 12, 2024
1 parent 4ffa38b commit 6ec03ee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
node_modules
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# syntax=docker/dockerfile:1.6
# ^ needed for ADD --checksum=…

FROM node:20-alpine as builder
WORKDIR /app

# install dependencies
# There are some (transitive) dependencies that need a C++ compiler, so we build them in a separate stage.
RUN apk add --update \
g++ \
make \
python3
ADD package.json /app
RUN npm install --production

# ---

FROM node:20-alpine
WORKDIR /app

LABEL org.opencontainers.image.title="vdv-453-nats-adapter"
LABEL org.opencontainers.image.description="An HTTP API for Berlin & Brandenburg public transport."
LABEL org.opencontainers.image.authors="Jannis R <[email protected]>"
LABEL org.opencontainers.image.documentation="https://github.com/derhuerst/vbb-rest/tree/7"

# install dependencies
COPY --from=builder /app/node_modules ./node_modules

# add source code
ADD . /app

# CLI some test
RUN ./cli.js --help >/dev/null

ENTRYPOINT [ "./cli.js"]

0 comments on commit 6ec03ee

Please sign in to comment.