116 lines
3.3 KiB
YAML
116 lines
3.3 KiB
YAML
# ===========================================
|
|
# Development Docker Compose
|
|
# Hot reload enabled, single command startup
|
|
# ===========================================
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
container_name: netflix-scraper-api-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PORT:-3000}:3000"
|
|
environment:
|
|
- NODE_ENV=development
|
|
- PORT=3000
|
|
- POSTGRES_HOST=postgres
|
|
- POSTGRES_PORT=5432
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
|
|
- POSTGRES_DB=${POSTGRES_DB:-netflix_scraper}
|
|
- REDIS_HOST=redis
|
|
- REDIS_PORT=6379
|
|
- REDIS_TTL_SECONDS=${REDIS_TTL_SECONDS:-604800}
|
|
- RATE_LIMIT_WINDOW_MS=${RATE_LIMIT_WINDOW_MS:-60000}
|
|
- RATE_LIMIT_MAX_REQUESTS=${RATE_LIMIT_MAX_REQUESTS:-30}
|
|
- API_KEY_WEB=${API_KEY_WEB:-web-dev-key-change-me}
|
|
- API_KEY_MOBILE=${API_KEY_MOBILE:-mobile-dev-key-change-me}
|
|
- API_KEY_ADMIN=${API_KEY_ADMIN:-admin-dev-key-secret}
|
|
- TMDB_API_KEY=${TMDB_API_KEY:-your-tmdb-api-key-here}
|
|
- TMDB_ACCESS_TOKEN=${TMDB_ACCESS_TOKEN:-your-tmdb-access-token-here}
|
|
volumes:
|
|
- ./src:/app/src:delegated
|
|
- ./prisma:/app/prisma:delegated
|
|
- ./package.json:/app/package.json:delegated
|
|
- node_modules_data:/app/node_modules
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- netflix-scraper-network
|
|
|
|
frontend:
|
|
image: node:20-alpine
|
|
container_name: netflix-scraper-frontend-dev
|
|
restart: unless-stopped
|
|
working_dir: /app
|
|
ports:
|
|
- "5173:5173"
|
|
environment:
|
|
- VITE_API_PROXY_TARGET=http://app:3000
|
|
command: sh -c "npm install && npm run dev -- --host 0.0.0.0 --port 5173"
|
|
volumes:
|
|
- ./frontend:/app:delegated
|
|
- frontend_node_modules_data:/app/node_modules
|
|
depends_on:
|
|
app:
|
|
condition: service_healthy
|
|
networks:
|
|
- netflix-scraper-network
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: netflix-scraper-postgres-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
|
|
- POSTGRES_DB=${POSTGRES_DB:-netflix_scraper}
|
|
volumes:
|
|
- postgres_data_dev:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-netflix_scraper}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
networks:
|
|
- netflix-scraper-network
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: netflix-scraper-redis-dev
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data_dev:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 5s
|
|
networks:
|
|
- netflix-scraper-network
|
|
|
|
volumes:
|
|
postgres_data_dev:
|
|
redis_data_dev:
|
|
node_modules_data:
|
|
frontend_node_modules_data:
|
|
|
|
networks:
|
|
netflix-scraper-network:
|
|
driver: bridge
|