Step 1 migration: add API service and dedicated PostgreSQL
This commit is contained in:
@@ -1,7 +1,38 @@
|
||||
services:
|
||||
video-games-db:
|
||||
image: postgres:16-alpine
|
||||
container_name: video-games-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=${VG_DB_NAME:-video_games}
|
||||
- POSTGRES_USER=${VG_DB_USER:-video_games_user}
|
||||
- POSTGRES_PASSWORD=${VG_DB_PASSWORD:-change_me}
|
||||
volumes:
|
||||
- video_games_data:/var/lib/postgresql/data
|
||||
|
||||
video-games-api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: api/Dockerfile
|
||||
container_name: video-games-api
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- video-games-db
|
||||
environment:
|
||||
- SERVICE_NAME=video-games-api
|
||||
- API_INTERNAL_PORT=3001
|
||||
- DATABASE_URL=postgres://${VG_DB_USER:-video_games_user}:${VG_DB_PASSWORD:-change_me}@video-games-db:5432/${VG_DB_NAME:-video_games}
|
||||
ports:
|
||||
- "${API_PORT:-7002}:3001"
|
||||
|
||||
video-games-app:
|
||||
build: .
|
||||
container_name: video-games-app
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- video-games-api
|
||||
ports:
|
||||
- "${APP_PORT:-7001}:80"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
video_games_data:
|
||||
|
||||
Reference in New Issue
Block a user