67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Main application - development version with hot reloading
|
|
app-dev:
|
|
build: .
|
|
container_name: qwen-nodejs-app-dev
|
|
ports:
|
|
- "19000:19000"
|
|
volumes:
|
|
- .:/app
|
|
- /app/node_modules # Don't mount node_modules, so they stay in the container
|
|
environment:
|
|
- NODE_ENV=development
|
|
- PORT=19000
|
|
- DB_HOST=postgres
|
|
- DB_PORT=5432
|
|
- DB_NAME=${DB_NAME:-moh_portal}
|
|
- DB_USER=${DB_USER:-postgres}
|
|
- DB_PASSWORD=${DB_PASSWORD:-postgres}
|
|
- JWT_SECRET=${JWT_SECRET:-secret_key_for_jwt_tokens}
|
|
- SESSION_SECRET=${SESSION_SECRET:-secret_key_for_session}
|
|
command: npm run dev # Use dev command for hot reloading
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
networks:
|
|
- moh-network
|
|
restart: unless-stopped
|
|
|
|
# PostgreSQL database
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: qwen-nodejs-postgres
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_DB=${DB_NAME:-moh_portal}
|
|
- POSTGRES_USER=${DB_USER:-postgres}
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
networks:
|
|
- moh-network
|
|
restart: unless-stopped
|
|
|
|
# Redis for session storage and caching
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: qwen-nodejs-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- moh-network
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
|
|
networks:
|
|
moh-network:
|
|
driver: bridge |