Refactor docker-compose.yml to use pre-built images for frontend and backend services
This commit is contained in:
parent
6e9b032e64
commit
ee4cf9c608
@ -1,21 +1,8 @@
|
|||||||
name: watch-party
|
name: watch-party
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# Frontend (Vite built → nginx). Only public-facing service on LAN.
|
|
||||||
web:
|
web:
|
||||||
build:
|
image: gitea.home.arpa/nik/watch-party-frontend:latest
|
||||||
context: ./frontend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
|
||||||
PUBLIC_BASE_PATH: ${PUBLIC_BASE_PATH}
|
|
||||||
FRONTEND_MODE: ${FRONTEND_MODE:-production}
|
|
||||||
VITE_AUTH_ENABLED: ${VITE_AUTH_ENABLED:-true}
|
|
||||||
VITE_FIREBASE_API_KEY: ${VITE_FIREBASE_API_KEY}
|
|
||||||
VITE_FIREBASE_AUTH_DOMAIN: ${VITE_FIREBASE_AUTH_DOMAIN}
|
|
||||||
VITE_FIREBASE_PROJECT_ID: ${VITE_FIREBASE_PROJECT_ID}
|
|
||||||
VITE_FIREBASE_APP_ID: ${VITE_FIREBASE_APP_ID}
|
|
||||||
VITE_BACKEND_ORIGIN: ${VITE_BACKEND_ORIGIN:-/api}
|
|
||||||
image: watchparty-frontend:prod
|
|
||||||
container_name: watchparty-frontend
|
container_name: watchparty-frontend
|
||||||
environment:
|
environment:
|
||||||
BACKEND_ORIGIN: ${BACKEND_ORIGIN}
|
BACKEND_ORIGIN: ${BACKEND_ORIGIN}
|
||||||
@ -32,7 +19,6 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
# Backend DB (internal only)
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
platform: ${COMPOSE_PLATFORM}
|
platform: ${COMPOSE_PLATFORM}
|
||||||
@ -42,7 +28,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
TZ: ${TZ}
|
TZ: ${TZ}
|
||||||
ports:
|
ports:
|
||||||
- "${POSTGRES_PORT:-5432}:5432" ####### TEMPORARY EXPOSE #########
|
- "${POSTGRES_PORT:-5432}:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
command: >
|
command: >
|
||||||
@ -62,12 +48,8 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks: [internal]
|
networks: [internal]
|
||||||
|
|
||||||
# One-off migration job (idempotent)
|
|
||||||
migrate:
|
migrate:
|
||||||
build:
|
image: gitea.home.arpa/nik/watch-party-backend:latest
|
||||||
context: ./backend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
image: watchparty-backend:latest
|
|
||||||
entrypoint: ["/app/migrate"]
|
entrypoint: ["/app/migrate"]
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
@ -79,9 +61,8 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
networks: [internal]
|
networks: [internal]
|
||||||
|
|
||||||
# API server (internal port only; reached via web → proxy)
|
|
||||||
api:
|
api:
|
||||||
image: watchparty-backend:latest
|
image: gitea.home.arpa/nik/watch-party-backend:latest
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -101,7 +82,7 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
ports:
|
ports:
|
||||||
- "${APP_PORT:-8082}:8082" ####### TEMPORARY EXPOSE #########
|
- "${APP_PORT:-8082}:8082"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
internal:
|
internal:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user