File size: 1,380 Bytes
01f542a
981c9de
64d76a2
639fa4a
981c9de
64d76a2
01f542a
 
 
 
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
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"]