2023-12-30 16:49:13 +01:00
|
|
|
FROM node:20-bullseye-slim as base
|
2023-02-09 17:21:25 +01:00
|
|
|
|
2024-01-07 14:59:51 +01:00
|
|
|
FROM base as production_buildstage
|
2021-09-08 12:20:19 +02:00
|
|
|
|
2022-04-09 08:58:22 +02:00
|
|
|
WORKDIR /home/node/app
|
2024-01-07 14:59:51 +01:00
|
|
|
COPY package.json package-lock.json ./
|
2021-09-08 12:20:19 +02:00
|
|
|
|
2022-04-09 08:58:22 +02:00
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
COPY --chown=node:node . ./
|
|
|
|
RUN npm run build
|
2021-09-08 12:20:19 +02:00
|
|
|
|
2024-01-07 14:59:51 +01:00
|
|
|
FROM base as production
|
|
|
|
|
2024-03-05 15:17:52 +01:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y postgresql-client
|
|
|
|
|
2024-01-07 14:59:51 +01:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
USER node
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
|
2024-03-05 15:17:52 +01:00
|
|
|
COPY package.json package-lock.json entrypoint.sh ./
|
2024-01-07 14:59:51 +01:00
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
COPY --from=production_buildstage /home/node/app/dist /home/node/app/dist
|
2021-09-08 12:20:19 +02:00
|
|
|
|
2024-03-05 15:17:52 +01:00
|
|
|
CMD ["./entrypoint.sh"]
|
2023-12-21 17:07:35 +01:00
|
|
|
|
|
|
|
FROM base as development
|
2024-01-07 14:59:51 +01:00
|
|
|
|
|
|
|
WORKDIR /home/node/app
|