File size: 1,025 Bytes
b9df4f3
51c6910
b9df4f3
 
 
f0b42e2
b9df4f3
51c6910
 
 
693d472
51c6910
 
b9df4f3
693d472
b9df4f3
 
 
 
 
 
 
 
51c6910
693d472
 
4a473dd
51c6910
 
 
b9df4f3
 
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
FROM nginx:alpine

# Install necessary packages for the backend server
RUN apk update && \
    apk add --no-cache xvfb libxcursor bash

# Copy backend server files and set permissions
COPY build/ /app/build/
COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
COPY etc/nginx/conf.d /etc/nginx/conf.d
COPY webgl-build /usr/share/nginx/html
COPY html-page /usr/share/nginx/html-page

# Set permissions for directories and files
RUN chmod +x /app/build/tanks.x86_64 && \
    mkdir -p /app/logs && \
    mkdir -p /var/log/nginx /var/lib/nginx /var/lib/nginx/body && \
    chown -R nginx:nginx /app /usr/share/nginx/html /usr/share/nginx/html-page /var/log/nginx /var/lib/nginx && \
    chmod 755 /var/log/nginx /var/lib/nginx /var/lib/nginx/body

# Copy and configure custom entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Set workdir
WORKDIR /app/

# Expose necessary ports
EXPOSE 80 7777/udp 7778/tcp 7860

# Set the entrypoint to start the backend server and Nginx
ENTRYPOINT ["/entrypoint.sh"]