feat: add Dockerfile for backend and frontend services with necessary configurations
This commit is contained in:
45
docker-compose.yml
Normal file
45
docker-compose.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
db:
|
||||
build:
|
||||
context: ./infra/postgres
|
||||
image: rail-game-postgres
|
||||
environment:
|
||||
POSTGRES_USER: railgame
|
||||
POSTGRES_PASSWORD: railgame
|
||||
POSTGRES_DB: railgame_dev
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend/Dockerfile
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://railgame:railgame@db:5432/railgame_dev
|
||||
TEST_DATABASE_URL: postgresql+psycopg://railgame:railgame@db:5432/railgame_test
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "8080:80"
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
Reference in New Issue
Block a user