-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
29 lines (22 loc) · 864 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
# Use the official lightweight Node.js 12 image.
# https://hub.docker.com/_/node
FROM node:14-slim
# Create and change to the app directory.
WORKDIR /usr/src/app
# set up the enviroment vars:
ENV PRODUCTION=true
ENV NODE_PORT=8080
ENV REACT_APP_PRODUCTION=true
ENV REACT_APP_NODE_PORT=8080
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY ./Frontend/package*.json ./Frontend/
COPY ./Frontend/yarn.lock ./Frontend/
# Install production dependencies.
RUN cd Frontend && yarn install
# Copy local code to the container image.
COPY ./Frontend ./Frontend/
RUN cd Frontend && npm run-script build
# Run the web service on container startup.
CMD [ "node", "./Frontend/server.js" ]