forked from UltiMafia/Ultimafia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
40 lines (29 loc) · 832 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
# Use the official Node.js image as the base image
FROM sitespeedio/node:ubuntu-20.04-nodejs-14.16.0
# Set the working directory in the container
WORKDIR /home/um
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies in the container
RUN npm install
# Install pm2 in the container
RUN npm install pm2 -g
# Expose Ports
EXPOSE 80
EXPOSE 2999
EXPOSE 3000
EXPOSE 3010
EXPOSE 9230
EXPOSE 9231
EXPOSE 9232
# Copy the content of the local src directory to the working directory
COPY . .
# Change directory to react_main
WORKDIR /home/um/react_main
RUN npm install
# Build static site
RUN bash build.sh && echo "Build finished."
# Change directory back to um root
WORKDIR /home/um
# Specify the command to run on container start
CMD ["pm2-runtime", "start", "pm2.json"]