From aeceab7cd7b29895af125cf43e8ac0b71ed7dcc3 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Tue, 25 Nov 2025 14:41:17 -0500 Subject: [PATCH] Add Docker setup with nginx for serving the game - Add Dockerfile using nginx:alpine base image - Add docker-compose.yml for easy container management - Add nginx.conf with minimal configuration and gzip compression - Service renamed to 'ui' for better naming convention --- Dockerfile | 11 +++++++++++ docker-compose.yml | 7 +++++++ nginx.conf | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..38d09b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM nginx:alpine + +# Copy the HTML file +COPY index.html /usr/share/nginx/html/index.html + +# Copy nginx configuration +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..747f7dd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +name: threejs-test + +services: + ui: + build: . + restart: unless-stopped + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..2c3229d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + + # Enable gzip compression + gzip on; + gzip_types text/html text/css application/javascript; + gzip_min_length 1000; +} +