2022-12-19 13:20:17 +01:00
|
|
|
FROM node:18-alpine as builder
|
2017-10-23 23:13:53 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-11-25 15:19:30 +01:00
|
|
|
# install dependencies
|
2020-05-01 20:17:07 +02:00
|
|
|
RUN apk add --update git bash
|
2023-09-06 14:39:39 +02:00
|
|
|
ADD package.json package-lock.json /app
|
|
|
|
RUN npm ci
|
2020-11-25 15:19:30 +01:00
|
|
|
|
|
|
|
# build documentation
|
|
|
|
ADD . /app
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# ---
|
2020-05-01 20:17:07 +02:00
|
|
|
|
2022-12-19 13:20:17 +01:00
|
|
|
FROM node:18-alpine
|
2021-10-19 11:20:19 +02:00
|
|
|
LABEL org.opencontainers.image.title="db-rest"
|
|
|
|
LABEL org.opencontainers.image.description="A clean REST API wrapping around the Deutsche Bahn API."
|
|
|
|
LABEL org.opencontainers.image.authors="Jannis R <mail@jannisr.de>"
|
2022-12-19 13:18:25 +01:00
|
|
|
LABEL org.opencontainers.image.documentation="https://github.com/derhuerst/db-rest/tree/6"
|
2021-10-19 11:20:19 +02:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/derhuerst/db-rest"
|
2022-12-19 13:18:25 +01:00
|
|
|
LABEL org.opencontainers.image.revision="6"
|
2021-10-19 11:20:19 +02:00
|
|
|
LABEL org.opencontainers.image.licenses="ISC"
|
2020-05-01 20:17:07 +02:00
|
|
|
WORKDIR /app
|
2017-10-23 23:13:53 +02:00
|
|
|
|
2020-11-25 15:19:30 +01:00
|
|
|
# install dependencies
|
|
|
|
ADD package.json /app
|
2021-09-13 18:14:43 +02:00
|
|
|
RUN npm install --production && npm cache clean --force
|
2020-11-25 15:19:30 +01:00
|
|
|
|
|
|
|
# add source code
|
|
|
|
ADD . /app
|
|
|
|
COPY --from=builder /app/docs ./docs
|
|
|
|
|
2017-10-23 23:13:53 +02:00
|
|
|
EXPOSE 3000
|
|
|
|
|
2022-12-19 13:18:25 +01:00
|
|
|
ENV HOSTNAME v6.db.transport.rest
|
2017-10-23 23:13:53 +02:00
|
|
|
ENV PORT 3000
|
|
|
|
|
2020-04-26 18:09:50 +02:00
|
|
|
CMD ["node", "index.js"]
|