-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (25 loc) · 1.04 KB
/
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
# A Dockerfile is a text file that contains instructions for building a Docker image.
# An image is a lightweight, stand-alone, executable package that includes everything
# needed to run a piece of software, including the code, a runtime, libraries,
# environment variables, and config files.
# specifies the base image to use
FROM node:lts-alpine
# Create folder for our application
WORKDIR /app
# copy all files and directories in the current directory into the /app directory in
# the Docker image. The source is the NASA Project, the destination is the /app folder
# i created
COPY package*.json ./
COPY client/package*.json client/
RUN npm run install-client
COPY server/package*.json server/
RUN npm run install-server
COPY client client/
RUN npm run build --prefix client
COPY server/ server/
# right before i start the server, set the user to use this container when running. the
# user has less previlege than the root user
USER node
# What to do when this Docker container start up
CMD [ "npm", "start", "--prefix", "server"]
EXPOSE 8000