Add docker-compose.yml

This commit is contained in:
2025-11-13 15:27:05 +00:00
commit 7421676664

35
docker-compose.yml Normal file
View File

@@ -0,0 +1,35 @@
version: "3.9"
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: medieval
POSTGRES_USER: medieval
POSTGRES_PASSWORD: medievalpass
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U medieval"]
interval: 5s
timeout: 5s
retries: 10
game:
build: ./server
environment:
NODE_ENV: production
DATABASE_URL: postgres://medieval:medievalpass@db:5432/medieval
JWT_SECRET: change-me-super-secret
PORT: 8080
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
volumes:
- ./server/static:/app/static
- ./server/src:/app/src
volumes:
dbdata: