You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.2 KiB
YAML
97 lines
2.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgis/postgis:15-3.3
|
|
container_name: polotsk-transit-db
|
|
environment:
|
|
POSTGRES_DB: polotsk_transit
|
|
POSTGRES_USER: transit_admin
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-change_me_in_production}
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./backend/migrations:/docker-entrypoint-initdb.d
|
|
networks:
|
|
- transit-network
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: polotsk-transit-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- transit-network
|
|
restart: unless-stopped
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: polotsk-transit-api
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3000
|
|
DATABASE_URL: postgresql://transit_admin:${DB_PASSWORD:-change_me_in_production}@postgres:5432/polotsk_transit
|
|
REDIS_URL: redis://redis:6379
|
|
API_KEY_SALT: ${API_KEY_SALT:-generate_random_salt}
|
|
JWT_SECRET: ${JWT_SECRET:-change_me_in_production_use_random_string}
|
|
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3001}
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
networks:
|
|
- transit-network
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./backend/logs:/app/logs
|
|
- avatars_data:/app/public/uploads/avatars
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
VITE_API_URL: ${API_URL:-http://localhost:3000/api/v1}
|
|
container_name: polotsk-transit-admin
|
|
environment:
|
|
VITE_API_URL: ${API_URL:-http://localhost:3000/api/v1}
|
|
ports:
|
|
- "3001:80"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- transit-network
|
|
restart: unless-stopped
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: polotsk-transit-nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/ssl:/etc/nginx/ssl:ro
|
|
depends_on:
|
|
- backend
|
|
- frontend
|
|
networks:
|
|
- transit-network
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
avatars_data:
|
|
|
|
networks:
|
|
transit-network:
|
|
driver: bridge
|