diff --git a/Dockerfile b/Dockerfile index c06359b..f3fa1d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN pip install --no-cache-dir -r backend/requirements.txt COPY backend/ /app/backend/ # Copy frontend files -COPY index.html manage.html /usr/share/nginx/html/ +COPY index.html manage.html yaml-validator.js /usr/share/nginx/html/ # Configure nginx RUN echo 'server {\n\ @@ -27,8 +27,10 @@ RUN echo 'server {\n\ root /usr/share/nginx/html;\n\ index index.html;\n\ \n\ - location / {\n\ - try_files $uri $uri/ /index.html;\n\ + # Serve JavaScript files with correct MIME type (must come before location /)\n\ + location ~* \\.js$ {\n\ + default_type application/javascript;\n\ + try_files $uri =404;\n\ }\n\ \n\ location /api {\n\ @@ -36,6 +38,10 @@ RUN echo 'server {\n\ proxy_set_header Host $host;\n\ proxy_set_header X-Real-IP $remote_addr;\n\ }\n\ + \n\ + location / {\n\ + try_files $uri $uri/ /index.html;\n\ + }\n\ }' > /etc/nginx/sites-available/default # Configure supervisor diff --git a/docker-compose.yml b/docker-compose.yml index bc1f59f..1463917 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: # Hot reload frontend (optional, for development) - ./index.html:/usr/share/nginx/html/index.html:ro,z - ./manage.html:/usr/share/nginx/html/manage.html:ro,z + - ./yaml-validator.js:/usr/share/nginx/html/yaml-validator.js:ro,z environment: # Set working directory for database - PWD=/app/data diff --git a/index.html b/index.html index 59a77d7..3cedc93 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Stronghold - Minecraft Server Generator +