217 lines
5.5 KiB
YAML
217 lines
5.5 KiB
YAML
services:
|
|
# Backend service with hot reload
|
|
backend:
|
|
build:
|
|
context: ../SerpentRace_Backend
|
|
dockerfile: ../SerpentRace_Docker/Dockerfile_backend.dev
|
|
container_name: serpentrace-backend-dev
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env.dev
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=development
|
|
- PORT=3000
|
|
- DB_HOST=postgres
|
|
- DB_PORT=5432
|
|
- DB_NAME=serpentrace
|
|
- DB_USERNAME=postgres
|
|
- DB_PASSWORD=postgres
|
|
- REDIS_URL=redis://redis:6379
|
|
- REDIS_HOST=redis
|
|
- REDIS_PORT=6379
|
|
- MINIO_ENDPOINT=minio
|
|
- MINIO_PORT=9000
|
|
- MINIO_ACCESS_KEY=serpentrace
|
|
- MINIO_SECRET_KEY=serpentrace123!
|
|
- MINIO_USE_SSL=false
|
|
volumes: [ ../SerpentRace_Backend/logs:/app/logs ]
|
|
develop:
|
|
watch:
|
|
- action: sync
|
|
path: ../SerpentRace_Backend/src
|
|
target: /app/src
|
|
ignore:
|
|
- node_modules/
|
|
- dist/
|
|
- "*.log"
|
|
- action: sync
|
|
path: ../SerpentRace_Backend/package.json
|
|
target: /app/package.json
|
|
- action: rebuild
|
|
path: ../SerpentRace_Backend/package-lock.json
|
|
- action: rebuild
|
|
path: ../SerpentRace_Backend/tsconfig.json
|
|
- action: rebuild
|
|
path: ./Dockerfile_backend.dev
|
|
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
networks:
|
|
- serpentrace-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Frontend service with hot reload
|
|
frontend:
|
|
build:
|
|
context: ../SerpentRace_Frontend
|
|
dockerfile: ../SerpentRace_Docker/Dockerfile_frontend.dev
|
|
container_name: serpentrace-frontend-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5173:5173"
|
|
environment:
|
|
- NODE_ENV=development
|
|
- VITE_API_URL=http://localhost:3000
|
|
volumes: []
|
|
develop:
|
|
watch:
|
|
- action: sync
|
|
path: ../SerpentRace_Frontend/src
|
|
target: /app/src
|
|
ignore:
|
|
- node_modules/
|
|
- dist/
|
|
- "*.log"
|
|
- action: sync
|
|
path: ../SerpentRace_Frontend/public
|
|
target: /app/public
|
|
- action: sync
|
|
path: ../SerpentRace_Frontend/package.json
|
|
target: /app/package.json
|
|
- action: rebuild
|
|
path: ../SerpentRace_Frontend/package-lock.json
|
|
- action: rebuild
|
|
path: ../SerpentRace_Frontend/vite.config.js
|
|
- action: rebuild
|
|
path: ./Dockerfile_frontend.dev
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- serpentrace-network
|
|
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: serpentrace-postgres-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_DB: serpentrace
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
|
|
volumes:
|
|
- postgres_dev_data:/var/lib/postgresql/data
|
|
- ./sql_dump_with_test_data.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
networks:
|
|
- serpentrace-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis Cache
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: serpentrace-redis-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_dev_data:/data
|
|
command: redis-server --appendonly yes
|
|
networks:
|
|
- serpentrace-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# MinIO Object Storage
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: serpentrace-minio-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
environment:
|
|
MINIO_ROOT_USER: serpentrace
|
|
MINIO_ROOT_PASSWORD: serpentrace123!
|
|
volumes:
|
|
- minio_dev_data:/data
|
|
command: server /data --console-address ":9001"
|
|
networks:
|
|
- serpentrace-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis Commander for development debugging
|
|
redis-commander:
|
|
image: rediscommander/redis-commander:latest
|
|
container_name: serpentrace-redis-commander-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8081:8081"
|
|
environment:
|
|
- REDIS_HOSTS=local:redis:6379
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- serpentrace-network
|
|
|
|
# Database administration tool
|
|
pgadmin:
|
|
image: dpage/pgadmin4:latest
|
|
container_name: serpentrace-pgadmin-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:80"
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: admin@serpentrace.dev
|
|
PGADMIN_DEFAULT_PASSWORD: admin
|
|
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
|
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
|
|
PGADMIN_CONFIG_WTF_CSRF_ENABLED: 'False'
|
|
volumes:
|
|
- pgadmin_dev_data:/var/lib/pgadmin
|
|
- ./pgadmin_servers.json:/pgadmin4/servers.json:ro
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- serpentrace-network
|
|
|
|
volumes:
|
|
postgres_dev_data:
|
|
driver: local
|
|
redis_dev_data:
|
|
driver: local
|
|
minio_dev_data:
|
|
driver: local
|
|
pgadmin_dev_data:
|
|
driver: local
|
|
|
|
networks:
|
|
serpentrace-network:
|
|
driver: bridge
|