feat: Containerize frontend and backend services with Docker and Docker Compose, enabling environment-based API configuration.
This commit is contained in:
32
compose.yml
32
compose.yml
@@ -1,6 +1,28 @@
|
||||
#services:
|
||||
# api:
|
||||
# db:
|
||||
services:
|
||||
backend:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
# In production, use a secure secret
|
||||
- SESSION_SECRET=dev_secret_key_12345
|
||||
- DATABASE_URL=sqlite:///app/data/notes.db
|
||||
- CORS_ALLOWED_ORIGINS=http://localhost:8080,http://localhost:5173
|
||||
- HOST=0.0.0.0
|
||||
- PORT=3000
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
|
||||
#volumes:
|
||||
# db_volume:
|
||||
frontend:
|
||||
build: ./k-notes-frontend
|
||||
ports:
|
||||
- "8080:80"
|
||||
environment:
|
||||
# This sets the default backend URL for the frontend
|
||||
- API_URL=http://localhost:3000
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
# Optional: Define volumes explicitly if needed
|
||||
# volumes:
|
||||
# backend_data:
|
||||
|
||||
Reference in New Issue
Block a user