diff options
| -rw-r--r-- | compose.prod.yaml | 29 | ||||
| -rw-r--r-- | nginx.conf | 10 |
2 files changed, 21 insertions, 18 deletions
diff --git a/compose.prod.yaml b/compose.prod.yaml index b2ad9fe..2c6c828 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -6,11 +6,24 @@ services: volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - files-data:/var/www/files:ro + - frontend-assets:/var/www/iosdc-japan/2025/code-battle:ro depends_on: - - api-server - - app-server + api-server: + condition: service_started + frontend: + condition: service_completed_successfully restart: always + frontend: + build: + context: ./frontend + args: + ALBATROSS_BASE_PATH: $ALBATROSS_BASE_PATH + volumes: + - frontend-assets:/output + entrypoint: ["sh", "-c", "cp -r /usr/share/nginx/html/. /output/"] + restart: "no" + api-server: build: context: ./backend @@ -32,17 +45,6 @@ services: env_file: [.env] restart: always - app-server: - build: - context: ./frontend - args: - ALBATROSS_HOST: localhost - ALBATROSS_BASE_PATH: $ALBATROSS_BASE_PATH - expose: - - 80 - env_file: [.env] - restart: always - db: image: postgres:16.3 environment: @@ -101,3 +103,4 @@ services: volumes: db-data: files-data: + frontend-assets: @@ -3,9 +3,13 @@ events { } http { + include mime.types; + server { listen 80; + root /var/www; + location /iosdc-japan/2025/code-battle/files/ { alias /var/www/files/; } @@ -27,11 +31,7 @@ http { } location /iosdc-japan/2025/code-battle/ { - proxy_pass http://app-server; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + try_files $uri $uri/ /iosdc-japan/2025/code-battle/index.html; } } } |
