working dev environment
This commit is contained in:
+3
-23
@@ -1,5 +1,6 @@
|
||||
# Dev-sidecar compose: app container + PostgreSQL sidecar.
|
||||
# Dev-sidecar compose: app container only (no database service).
|
||||
# Used by .devcontainer/devcontainer.json via dockerComposeFile.
|
||||
# Development uses SQLite — no Docker-in-Docker database needed.
|
||||
|
||||
services:
|
||||
app:
|
||||
@@ -11,15 +12,12 @@ services:
|
||||
- "8000:8000" # FastAPI
|
||||
- "4200:4200" # Angular dev server
|
||||
environment:
|
||||
KMTN_DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/kmountain
|
||||
KMTN_DATABASE_URL: sqlite+aiosqlite:///./backend/kmountain.db
|
||||
KMTN_CORS_ORIGINS: '["http://localhost:4200"]'
|
||||
volumes:
|
||||
- ..:/workspaces/web_app:cached
|
||||
- node_modules:/workspaces/web_app/node_modules
|
||||
- backend_venv:/app/.venv
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
command: >
|
||||
sh -c "
|
||||
pip install -r backend/requirements.txt &&
|
||||
@@ -30,24 +28,6 @@ services:
|
||||
npx ng serve --host 0.0.0.0 --port 4200
|
||||
"
|
||||
|
||||
db:
|
||||
image: docker.io/library/postgres:16-alpine
|
||||
restart: "no"
|
||||
environment:
|
||||
POSTGRES_DB: kmountain
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
node_modules:
|
||||
backend_venv:
|
||||
|
||||
Reference in New Issue
Block a user