generated from technologiestiftung/template-repo-citylab
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
29 lines (21 loc) · 768 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM node:20.11.0-bookworm-slim AS build
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 build-essential
COPY . .
RUN npm ci && npm run build
FROM node:20.11.0-bookworm-slim
ARG PORT=8080
ENV PORT $PORT
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/dist /usr/src/app/package.json /usr/src/app/package-lock.json ./
RUN apt-get update && apt-get install -y python3 build-essential && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN
RUN npm ci --production
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN chown -R node /usr/src/app
USER node
EXPOSE 8080
ENTRYPOINT ["/tini", "--"]
CMD ["node", "index.js"]