clone3 commited on
Commit
f0b42e2
·
verified ·
1 Parent(s): 2391cb0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -19
Dockerfile CHANGED
@@ -1,41 +1,41 @@
1
- FROM ubuntu:bionic as backend
2
 
3
- # Install necessary packages for the backend server
4
  RUN apt-get update && \
5
  apt-get upgrade -y && \
6
- apt-get install -y libglu1 xvfb libxcursor1 net-tools
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- # Copy backend server files
9
  COPY build/ /app/build/
10
  COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
11
  COPY etc/nginx/conf.d /etc/nginx/conf.d
12
  COPY webgl-build /usr/share/nginx/html
13
  COPY html-page /usr/share/nginx/html-page
14
 
15
- # Set permissions and create logs directory
16
  RUN chmod +x /app/build/tanks.x86_64 && \
17
- mkdir -p /app/logs && \
18
- mkdir -p /var/log/nginx /var/lib/nginx && \
19
  chown -R www-data:www-data /var/log/nginx /var/lib/nginx /app /usr/share/nginx/html /usr/share/nginx/html-page
20
 
21
- # Install Nginx and dependencies
22
- RUN apt-get update && \
23
- DEBIAN_FRONTEND=noninteractive apt-get install -y nginx && \
24
- apt-get clean && \
25
- rm -rf /var/lib/apt/lists/*
26
-
27
- # Ensure the configuration files are set correctly
28
- RUN echo 'nginx-common nginx-common/upgrade_type select none' | debconf-set-selections && \
29
- echo 'nginx-common nginx-common/upgrade select none' | debconf-set-selections && \
30
- dpkg --configure -a
31
-
32
  # Set workdir
33
  WORKDIR /app/
34
 
35
  # Expose necessary ports
36
  EXPOSE 80 7777/udp 7778/tcp 7860
37
 
38
- # Combine backend server and Nginx start commands
39
  CMD xvfb-run -ae /dev/stdout \
40
  --server-args='-screen 0 640x480x24:32' \
41
  /app/build/tanks.x86_64 -batchmode -nographics -logfile /app/logs/server.log & \
 
1
+ FROM ubuntu:bionic
2
 
3
+ # Install necessary packages and Nginx
4
  RUN apt-get update && \
5
  apt-get upgrade -y && \
6
+ apt-get install -y \
7
+ libglu1 \
8
+ xvfb \
9
+ libxcursor1 \
10
+ net-tools \
11
+ nginx \
12
+ debconf-utils \
13
+ && apt-get clean && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+ # Set default configuration options to avoid prompts
17
+ RUN echo 'nginx-common nginx-common/upgrade_type select none' | debconf-set-selections && \
18
+ echo 'nginx-common nginx-common/upgrade select none' | debconf-set-selections
19
 
20
+ # Copy configuration and application files
21
  COPY build/ /app/build/
22
  COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
23
  COPY etc/nginx/conf.d /etc/nginx/conf.d
24
  COPY webgl-build /usr/share/nginx/html
25
  COPY html-page /usr/share/nginx/html-page
26
 
27
+ # Set permissions
28
  RUN chmod +x /app/build/tanks.x86_64 && \
29
+ mkdir -p /app/logs /var/log/nginx /var/lib/nginx && \
 
30
  chown -R www-data:www-data /var/log/nginx /var/lib/nginx /app /usr/share/nginx/html /usr/share/nginx/html-page
31
 
 
 
 
 
 
 
 
 
 
 
 
32
  # Set workdir
33
  WORKDIR /app/
34
 
35
  # Expose necessary ports
36
  EXPOSE 80 7777/udp 7778/tcp 7860
37
 
38
+ # Start the backend server and Nginx
39
  CMD xvfb-run -ae /dev/stdout \
40
  --server-args='-screen 0 640x480x24:32' \
41
  /app/build/tanks.x86_64 -batchmode -nographics -logfile /app/logs/server.log & \