HomeSok / Dockerfile
Kano001's picture
Update Dockerfile
981c9de verified
FROM ubuntu:bionic
MAINTAINER Edgegap <[email protected]>
ARG DEBIAN_FRONTEND=noninteractive
ARG DOCKER_VERSION=17.06.0-ce
RUN apt-get update && \
apt-get install -y libglu1 xvfb libxcursor1 ca-certificates && \
apt-get clean && \
update-ca-certificates
# Set working directory
WORKDIR /app
# Copy the Unity build (assuming the build is in the 'build' directory)
COPY build/ ./
# Make the server executable
RUN chmod +x ./server.x86_64
# Stage 2: Setup Nginx and serve static files
FROM nginx:alpine AS webserver
# Copy static website files
COPY static-site/ /usr/share/nginx/html
# Copy Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Stage 3: Run the Mirror server and Nginx in the final container
FROM ubuntu:20.04
# Install dependencies
RUN apt-get update && apt-get install -y \
xvfb \
supervisor \
&& rm -rf /var/lib/apt/lists/*
# Copy the server files from the builder stage
COPY --from=builder /app /app
# Copy Nginx and static site from webserver stage
COPY --from=webserver /usr/share/nginx/html /usr/share/nginx/html
COPY --from=webserver /etc/nginx/nginx.conf /etc/nginx/nginx.conf
# Copy Supervisor configuration
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose ports for Nginx and the Mirror server
EXPOSE 7860 7777
# Start Supervisor to manage both processes
CMD ["/usr/bin/supervisord"]