forked from ccported/ccported.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (22 loc) · 770 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
FROM node:20.16.0
WORKDIR /usr/local/ccported
# Proxy server
COPY server/package.json /usr/local/ccported/
RUN npm install
COPY server/client.js /usr/local/ccported/
COPY server/index.js /usr/local/ccported/
ENV node_env=production
ENV port=3000
# Static files
# install nginx
RUN apt-get update && apt-get install -y nginx
# remove the default config file
RUN rm /etc/nginx/sites-enabled/default
# copy the config file from the current directory and paste it inside the container
COPY server/nginx.conf /etc/nginx/sites-enabled/
# copy the static files from the static directory and paste it inside the container
COPY /static /usr/share/nginx/html
# expose the port
EXPOSE 80
# Start nginx and node
CMD ["sh", "-c", "service nginx start && node index.js"];