Spaces:
Build error
Build error
Create Dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152FROM ubuntu:bionic as backend
# Install necessary packages for the backend serverRUN apt-get update && \ apt-get install -y libglu1 xvfb libxcursor1 net-tools
# Copy backend server filesCOPY build/ /app/build/COPY entrypoint.sh /entrypoint.sh
# Make entrypoint script executableRUN chmod +x /entrypoint.sh && chmod +x /app/build/tanks.x86_64
# Create logs directoryRUN mkdir -p /app/logs
# Set workdirWORKDIR /app/
FROM nginx:alpine as web_client
# Copy WebGL build filesCOPY webgl-build /usr/share/nginx/html
# Copy Nginx configuration filesCOPY etc/nginx/nginx.conf /etc/nginx/nginx.confCOPY etc/nginx/conf.d /etc/nginx/conf.d
# Copy HTML page for port 7860COPY html-page /usr/share/nginx/html-page
FROM ubuntu:bionic
# Install necessary packages for backend and NginxRUN apt-get update && \ apt-get install -y libglu1 xvfb libxcursor1 net-tools nginx
# Copy files from previous stagesCOPY --from=backend /app/ /app/COPY --from=web_client /usr/share/nginx/html /usr/share/nginx/htmlCOPY --from=web_client /usr/share/nginx/html-page /usr/share/nginx/html-pageCOPY --from=web_client /etc/nginx/nginx.conf /etc/nginx/nginx.confCOPY --from=web_client /etc/nginx/conf.d /etc/nginx/conf.d
# Expose necessary portsEXPOSE 80 7777/udp 7778/tcp 7860
# Entry point scriptCOPY entrypoint_combined.sh /entrypoint_combined.shRUN chmod +x /entrypoint_combined.sh
ENTRYPOINT ["/bin/bash", "/entrypoint_combined.sh"]DockerfileAdded+52