96 lines
2.3 KiB
YAML
96 lines
2.3 KiB
YAML
|
|
version: '3.8'
|
||
|
|
|
||
|
|
services:
|
||
|
|
backend:
|
||
|
|
build:
|
||
|
|
context: ./backend
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
container_name: crafting-shop-backend
|
||
|
|
ports:
|
||
|
|
- "5000:5000"
|
||
|
|
environment:
|
||
|
|
- FLASK_ENV=${FLASK_ENV:-prod}
|
||
|
|
- SECRET_KEY=${SECRET_KEY}
|
||
|
|
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
|
||
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||
|
|
depends_on:
|
||
|
|
- postgres
|
||
|
|
- redis
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
volumes:
|
||
|
|
- backend-data:/app/instance
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
frontend:
|
||
|
|
build:
|
||
|
|
context: ./frontend
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
container_name: crafting-shop-frontend
|
||
|
|
ports:
|
||
|
|
- "80:80"
|
||
|
|
depends_on:
|
||
|
|
- backend
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
image: postgres:15-alpine
|
||
|
|
container_name: crafting-shop-postgres
|
||
|
|
environment:
|
||
|
|
- POSTGRES_USER=${POSTGRES_USER:-crafting}
|
||
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||
|
|
- POSTGRES_DB=${POSTGRES_DB:-crafting_shop}
|
||
|
|
volumes:
|
||
|
|
- postgres-data:/var/lib/postgresql/data
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
redis:
|
||
|
|
image: redis:7-alpine
|
||
|
|
container_name: crafting-shop-redis
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
prometheus:
|
||
|
|
image: prom/prometheus:latest
|
||
|
|
container_name: crafting-shop-prometheus
|
||
|
|
ports:
|
||
|
|
- "9090:9090"
|
||
|
|
volumes:
|
||
|
|
- ./infrastructure/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
|
||
|
|
- prometheus-data:/prometheus
|
||
|
|
command:
|
||
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||
|
|
- '--storage.tsdb.path=/prometheus'
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
grafana:
|
||
|
|
image: grafana/grafana:latest
|
||
|
|
container_name: crafting-shop-grafana
|
||
|
|
ports:
|
||
|
|
- "3001:3000"
|
||
|
|
environment:
|
||
|
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
|
||
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
|
||
|
|
volumes:
|
||
|
|
- grafana-data:/var/lib/grafana
|
||
|
|
networks:
|
||
|
|
- crafting-shop-network
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres-data:
|
||
|
|
redis-data:
|
||
|
|
prometheus-data:
|
||
|
|
grafana-data:
|
||
|
|
backend-data:
|
||
|
|
|
||
|
|
networks:
|
||
|
|
crafting-shop-network:
|
||
|
|
driver: bridge
|