Files
daily-journal-prompt/docker-compose.yml
2026-01-03 13:18:42 -07:00

95 lines
2.2 KiB
YAML

version: '3.8'
services:
backend:
build: ./backend
container_name: daily-journal-prompt-backend
ports:
- "8000:8000"
volumes:
- ./backend:/app
- ./data:/app/data
environment:
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- API_BASE_URL=${API_BASE_URL:-https://api.deepseek.com}
- MODEL=${MODEL:-deepseek-chat}
- DEBUG=${DEBUG:-false}
- ENVIRONMENT=${ENVIRONMENT:-development}
env_file:
- .env
develop:
watch:
- action: sync
path: ./backend
target: /app
ignore:
- __pycache__/
- .pytest_cache/
- .coverage
- action: rebuild
path: ./backend/requirements.txt
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- journal-network
frontend:
build: ./frontend
container_name: daily-journal-prompt-frontend
ports:
- "3000:80" # Production frontend on nginx
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=${NODE_ENV:-production}
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- journal-network
# Development frontend (hot reload)
frontend-dev:
build:
context: ./frontend
target: builder
container_name: daily-journal-prompt-frontend-dev
ports:
- "3001:3000" # Development server on different port
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
command: npm run dev
develop:
watch:
- action: sync
path: ./frontend/src
target: /app/src
- action: rebuild
path: ./frontend/package.json
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- journal-network
networks:
journal-network:
driver: bridge
volumes:
data:
driver: local