File size: 1,588 Bytes
64d76a2 3f6526a d3ff19c 3f6526a |
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
FROM ubuntu:20.04
# Set the timezone environment variable (example: America/New_York)
ENV TZ=America/New_York
# Install tzdata package and set timezone non-interactively
RUN apt-get update && apt-get install -y tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apt-get clean
# Install dependencies
RUN apt-get update && apt-get install -y \
xvfb \
wine \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
# 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"]
|