update .env.example and docker config
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
DATABASE_URL=postgresql+asyncpg://codetutor:codetutor@localhost:5432/codetutor
|
||||
# Database connection - REQUIRED
|
||||
# Format: postgresql+asyncpg://USER:PASSWORD@HOST:PORT/DATABASE
|
||||
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/codetutor
|
||||
|
||||
# Debug mode (optional, default: false)
|
||||
DEBUG=false
|
||||
|
||||
# CORS allowed origins (optional, default: ["http://localhost:3000"])
|
||||
CORS_ORIGINS=["http://localhost:3000"]
|
||||
|
||||
@@ -3,15 +3,15 @@ services:
|
||||
image: postgres:16-alpine
|
||||
container_name: codetutor-db
|
||||
environment:
|
||||
POSTGRES_USER: codetutor
|
||||
POSTGRES_PASSWORD: codetutor
|
||||
POSTGRES_DB: codetutor
|
||||
POSTGRES_USER: ${POSTGRES_USER:-codetutor}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-codetutor}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- codetutor-db-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U codetutor"]
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-codetutor}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -22,7 +22,7 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
container_name: codetutor-backend
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://codetutor:codetutor@db:5432/codetutor
|
||||
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-codetutor}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-codetutor}
|
||||
CORS_ORIGINS: '["http://localhost:3000"]'
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Reference in New Issue
Block a user