-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 829 Bytes
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
FROM node:14.0.0-buster-slim
ENV BUILD_PATH /usr/src/app
ENV COMMIT_SHORT COMMIT_PLACEHOLDER
ENV DOCKER_TAG TAG_PLACEHOLDER
RUN mkdir -p $BUILD_PATH
WORKDIR $BUILD_PATH
COPY . $BUILD_PATH
RUN npm install
RUN npm run build
FROM node:14.0.0-buster-slim
ENV SERVER_FOLDER /opt/app/
RUN mkdir -p $SERVER_FOLDER
WORKDIR $SERVER_FOLDER
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
RUN npm install --global express && npm link express && \
npm install --global http-proxy-middleware && npm link http-proxy-middleware
ENV NODE_SERVER_PORT=${NODE_SERVER_PORT:-8080}
COPY server/ $SERVER_FOLDER/server
RUN mkdir -p $SERVER_FOLDER/src
COPY src/setupProxy.js $SERVER_FOLDER/src/setupProxy.js
COPY --from=0 /usr/src/app/build $SERVER_FOLDER/build
EXPOSE $NODE_SERVER_PORT $NODE_INSPECT_PORT
ENTRYPOINT exec node ./server/server.js