anotherDocker / Dockerfile
clone3's picture
Update Dockerfile
1eb9ab4 verified
raw
history blame
1.22 kB
FROM ubuntu:bionic
# Install necessary packages including xvfb and Nginx
RUN apt-get update && \
apt-get install -y \
xvfb \
nginx \
libxcursor1 \
bash && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create application directories
RUN mkdir -p /app /app/build /var/log/nginx /var/lib/nginx /var/cache/nginx /usr/share/nginx/html /usr/share/nginx/html-page
# Copy backend server files and set permissions
COPY build/ /app/build/
COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
COPY etc/nginx/conf.d /etc/nginx/conf.d
COPY webgl-build /usr/share/nginx/html
COPY html-page /usr/share/nginx/html-page
# Set ownership and permissions for Nginx directories
RUN chown -R www-data:www-data /var/log/nginx /var/lib/nginx /var/cache/nginx /usr/share/nginx/html /usr/share/nginx/html-page && \
chmod 755 /var/log/nginx /var/lib/nginx /var/cache/nginx /usr/share/nginx/html /usr/share/nginx/html-page
# Copy and configure custom entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set workdir
WORKDIR /app/
# Expose necessary ports
EXPOSE 80 7777/udp 7778/tcp 7860
# Set the entrypoint to start the backend server and Nginx
ENTRYPOINT ["/entrypoint.sh"]