anotherDocker / Dockerfile
clone3's picture
Update Dockerfile
072c9bf verified
raw
history blame
1.51 kB
FROM ubuntu:bionic as backend
# Install necessary packages for the backend server
RUN apt-get update && \
apt-get install -y libglu1 xvfb libxcursor1 net-tools
# Copy backend server files
COPY build/ /app/build/
COPY entrypoint_combined.sh /app/entrypoint_combined.sh
# Set permissions and create logs directory
RUN chmod 755 /app/build/tanks.x86_64 && \
chmod +x /app/entrypoint_combined.sh && \
mkdir -p /app/logs
# Set workdir
WORKDIR /app/
FROM nginx:alpine as web_client
# Copy WebGL build files
COPY webgl-build /usr/share/nginx/html
# Copy Nginx configuration files
COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
COPY etc/nginx/conf.d /etc/nginx/conf.d
# Copy HTML page for port 7860
COPY html-page /usr/share/nginx/html-page
FROM ubuntu:bionic
# Install necessary packages for backend and Nginx
RUN apt-get update && \
apt-get install -y libglu1 xvfb libxcursor1 net-tools nginx
# Copy files from previous stages
COPY --from=backend /app/ /app/
COPY --from=web_client /usr/share/nginx/html /usr/share/nginx/html
COPY --from=web_client /usr/share/nginx/html-page /usr/share/nginx/html-page
COPY --from=web_client /etc/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=web_client /etc/nginx/conf.d /etc/nginx/conf.d
# Set permissions for Nginx log directory
RUN mkdir -p /var/log/nginx && \
chown -R www-data:www-data /var/log/nginx
# Expose necessary ports
EXPOSE 80 7777/udp 7778/tcp 7860
# Entry point script
ENTRYPOINT ["/bin/bash", "/app/entrypoint_combined.sh"]