aboutsummaryrefslogtreecommitdiffhomepage
path: root/compose.prod.yaml
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-13 23:00:47 +0900
committernsfisis <nsfisis@gmail.com>2026-02-13 23:07:26 +0900
commit373dbf12f6797497656565e9baa7ac69e1f005f5 (patch)
treee57a4a0a348bbfdbfa0ecc494e6c28706fa0ea90 /compose.prod.yaml
parent17cfaf8e3edccffb02217157d8d9cd126c7c0b89 (diff)
downloadphperkaigi-2026-albatross-373dbf12f6797497656565e9baa7ac69e1f005f5.tar.gz
phperkaigi-2026-albatross-373dbf12f6797497656565e9baa7ac69e1f005f5.tar.zst
phperkaigi-2026-albatross-373dbf12f6797497656565e9baa7ac69e1f005f5.zip
refactor(infra): serve frontend static files via nginx volume mount
Replace app-server proxy with direct static file serving from nginx. The frontend service builds assets into a shared volume, and the reverse-proxy serves them with SPA fallback via try_files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'compose.prod.yaml')
-rw-r--r--compose.prod.yaml29
1 files changed, 16 insertions, 13 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: