init FastAPI Backend incl. postgresDb

This commit is contained in:
2025-12-05 11:39:58 +01:00
commit 6540ef1c16
3 changed files with 39 additions and 0 deletions

24
docker-compose.yaml Normal file
View File

@@ -0,0 +1,24 @@
services:
api:
build: .
container_name: url_api
ports:
- "8000:8000"
environment:
DATABASE_URL: "postgresql://user:password@db:5432/urlshort"
depends_on:
- db
db:
image: postgres:16
container_name: url_db
restart: always
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: urlshort
volumes:
- db_data:/var/lib/postgresql/data
volumes:
db_data: