forked from panosc-eu/wp2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (25 loc) · 771 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM node:12-alpine AS build-stage
USER node
RUN mkdir -p /home/node/app
WORKDIR /home/node/app
COPY --chown=node:node package*.json ./
RUN npm ci --loglevel error --no-fund
COPY --chown=node:node . .
RUN npm run build
FROM node:12-alpine
USER node
RUN mkdir -p /home/node/app
WORKDIR /home/node/app
COPY --from=build-stage --chown=node:node /home/node/app/build ./build
COPY --from=build-stage --chown=node:node /home/node/app/package*.json ./
USER root
# Add wait-for-it
RUN apk update && apk add bash
COPY wait-for-it.sh wait-for-it.sh
RUN chmod +x wait-for-it.sh
USER root
RUN npm ci --only=production --loglevel error --no-fund
ARG BUILD_VERSION=<unknown>
RUN echo $BUILD_VERSION > build-version.txt
EXPOSE 4000
CMD [ "node", "./build/index.js" ]