feat(docker): add PostgreSQL database container
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
# Backend Environment
|
||||||
|
SECRET_KEY=change-me-to-a-long-random-string-in-production
|
||||||
|
DB_PASSWORD=change-me-to-a-secure-password
|
||||||
|
|
||||||
|
# Optional: PostgreSQL (empfohlen für production)
|
||||||
|
# DATABASE_URL wird automatisch gesetzt: postgresql://wrestledesk:DB_PASSWORD@db:5432/wrestledesk
|
||||||
+16
-1
@@ -1,10 +1,25 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:15-alpine
|
||||||
|
container_name: wrestledesk-db
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./postgres-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=wrestledesk
|
||||||
|
- POSTGRES_USER=wrestledesk
|
||||||
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
||||||
|
networks:
|
||||||
|
- wrestledesk-network
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build: ./backend
|
build: ./backend
|
||||||
container_name: wrestledesk-backend
|
container_name: wrestledesk-backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
ports:
|
ports:
|
||||||
- '10002:8000'
|
- '10002:8000'
|
||||||
volumes:
|
volumes:
|
||||||
@@ -15,7 +30,7 @@ services:
|
|||||||
- DEBUG=False
|
- DEBUG=False
|
||||||
- ALLOWED_HOSTS=localhost,127.0.0.1,rce.playman.top,192.168.101.42,nginx-proxy-manager
|
- ALLOWED_HOSTS=localhost,127.0.0.1,rce.playman.top,192.168.101.42,nginx-proxy-manager
|
||||||
- CORS_ALLOWED_ORIGINS=https://rce.playman.top,http://192.168.101.42:10001,http://192.168.101.42:10002
|
- CORS_ALLOWED_ORIGINS=https://rce.playman.top,http://192.168.101.42:10001,http://192.168.101.42:10002
|
||||||
- DATABASE_URL=${DATABASE_URL}
|
- DATABASE_URL=postgresql://wrestledesk:${DB_PASSWORD}@db:5432/wrestledesk
|
||||||
networks:
|
networks:
|
||||||
- wrestledesk-network
|
- wrestledesk-network
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user