From 091ec0f716a0f239654f82698bf8709a0e7d2c34 Mon Sep 17 00:00:00 2001 From: miwr Date: Wed, 16 Apr 2025 15:17:36 +0200 Subject: [PATCH] should be working now --- Dockerfile | 3 ++- nginx.conf | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ff86bd..82fc4ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,8 @@ RUN npm run build --prod FROM nginx:alpine RUN rm /etc/nginx/conf.d/default.conf -COPY --from=builder /app/dist/silly-game-frontend /usr/share/nginx/html +COPY --from=builder /app/dist/silly-game-frontend/browser /usr/share/nginx/html/browser/silly-game +COPY --from=builder /app/dist/silly-game-frontend/3rdpartylicenses.txt /usr/share/nginx/html/3rdpartylicenses.txt COPY ./nginx.conf /etc/nginx/conf.d/my-angular-app.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 56602a8..1529002 100644 --- a/nginx.conf +++ b/nginx.conf @@ -2,12 +2,9 @@ server { listen 80; server_name _; - location / { - root /usr/share/nginx/html/browser; # This is crucial! + location /silly-game { + root /usr/share/nginx/html/browser; index index.html index.html; - rewrite ^/silly-game/(.*)$ /$1 break; - try_files $uri $uri/ /index.html; # For Angular routing + try_files $uri $uri/ /index.html; } - - # Optional: Add other configurations like gzip, headers, etc. } \ No newline at end of file