Update Dockerfile
Browse files- Dockerfile +14 -21
Dockerfile
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
FROM nikolaik/python-nodejs:python3.10-nodejs18
|
2 |
|
3 |
-
# Install necessary packages, including xvfb
|
4 |
USER root
|
5 |
|
6 |
RUN apt-get -y update && \
|
@@ -8,41 +7,35 @@ RUN apt-get -y update && \
|
|
8 |
apt-get clean && \
|
9 |
update-ca-certificates
|
10 |
|
11 |
-
# Create necessary directories and set permissions for 'pn'
|
12 |
RUN mkdir -p /var/cache/nginx \
|
13 |
/var/log/nginx \
|
14 |
-
/var/lib/nginx
|
15 |
-
|
16 |
-
/home/pn/app/build
|
17 |
|
18 |
RUN chown -R pn:pn /var/cache/nginx \
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
/home/pn/app/build
|
23 |
|
24 |
-
# Switch to non-root user 'pn'
|
25 |
USER pn
|
26 |
ENV HOME=/home/pn \
|
27 |
PATH=/home/pn/.local/bin:$PATH
|
28 |
|
29 |
-
|
30 |
-
WORKDIR /home/pn/app
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
35 |
|
36 |
COPY --chown=pn nginx.conf /etc/nginx/sites-available/default
|
37 |
|
38 |
-
# Copy Unity game server build
|
39 |
COPY --chown=pn build/ /home/pn/app/build/
|
40 |
|
41 |
-
# Copy the run script
|
42 |
COPY --chown=pn run.sh /home/pn/app/
|
43 |
|
44 |
-
#
|
45 |
-
|
|
|
46 |
|
47 |
-
|
48 |
-
CMD ["bash", "run.sh"]
|
|
|
1 |
FROM nikolaik/python-nodejs:python3.10-nodejs18
|
2 |
|
|
|
3 |
USER root
|
4 |
|
5 |
RUN apt-get -y update && \
|
|
|
7 |
apt-get clean && \
|
8 |
update-ca-certificates
|
9 |
|
|
|
10 |
RUN mkdir -p /var/cache/nginx \
|
11 |
/var/log/nginx \
|
12 |
+
/var/lib/nginx
|
13 |
+
RUN touch /var/run/nginx.pid
|
|
|
14 |
|
15 |
RUN chown -R pn:pn /var/cache/nginx \
|
16 |
+
/var/log/nginx \
|
17 |
+
/var/lib/nginx \
|
18 |
+
/var/run/nginx.pid
|
|
|
19 |
|
|
|
20 |
USER pn
|
21 |
ENV HOME=/home/pn \
|
22 |
PATH=/home/pn/.local/bin:$PATH
|
23 |
|
24 |
+
RUN mkdir $HOME/app
|
|
|
25 |
|
26 |
+
WORKDIR $HOME/app
|
27 |
+
|
28 |
+
COPY --chown=pn requirements.txt requirements.txt
|
29 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
30 |
|
31 |
COPY --chown=pn nginx.conf /etc/nginx/sites-available/default
|
32 |
|
|
|
33 |
COPY --chown=pn build/ /home/pn/app/build/
|
34 |
|
|
|
35 |
COPY --chown=pn run.sh /home/pn/app/
|
36 |
|
37 |
+
#RUN chmod +x /home/pn/app/build/linuxBuild.x86_64
|
38 |
+
|
39 |
+
COPY --chown=pn . .
|
40 |
|
41 |
+
CMD ["bash", "run.sh"]
|
|