anotherDocker / Dockerfile
clone3's picture
Create Dockerfile
51c6910 verified
raw
history blame
1.44 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.sh /entrypoint.sh
# Make entrypoint script executable
RUN chmod +x /entrypoint.sh && chmod +x /app/build/tanks.x86_64
# Create logs directory
RUN 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
# Expose necessary ports
EXPOSE 80 7777/udp 7778/tcp 7860
# Entry point script
COPY entrypoint_combined.sh /entrypoint_combined.sh
RUN chmod +x /entrypoint_combined.sh
ENTRYPOINT ["/bin/bash", "/entrypoint_combined.sh"]