137 lines
3.7 KiB
YAML
137 lines
3.7 KiB
YAML
x-app-env-file: &app_env_file
|
|
- ${APP_ENV_FILE:-.env}
|
|
|
|
x-app-environment: &app_environment
|
|
IMAGE_TAG: ${IMAGE_TAG:-latest}
|
|
POSTGRES_HOST: postgres
|
|
REDIS_URL: redis://redis:6379/0
|
|
WEBHOOK_BASE_URL: ${WEBHOOK_PUBLIC_URL:?set WEBHOOK_PUBLIC_URL in .env}
|
|
SUBSCRIPTION_MINI_APP_URL: ${MINIAPP_PUBLIC_URL:?set MINIAPP_PUBLIC_URL in .env}
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:?set POSTGRES_USER in .env}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
|
|
POSTGRES_DB: ${POSTGRES_DB:?set POSTGRES_DB in .env}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
networks:
|
|
- remnawave-shop
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- remnawave-shop
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
|
|
migrate:
|
|
image: 3252a8/remnawave-minishop-backend:${IMAGE_TAG:-latest}
|
|
restart: "no"
|
|
command: ["python", "backend/main_migrate.py"]
|
|
env_file: *app_env_file
|
|
environment:
|
|
<<: *app_environment
|
|
volumes:
|
|
- shop-data:/app/data
|
|
networks:
|
|
- remnawave-shop
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
backend:
|
|
image: 3252a8/remnawave-minishop-backend:${IMAGE_TAG:-latest}
|
|
restart: unless-stopped
|
|
env_file: *app_env_file
|
|
environment:
|
|
<<: *app_environment
|
|
WEBAPP_ENABLED: ${WEBAPP_ENABLED:-true}
|
|
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.1,::1}
|
|
ports:
|
|
- "${WEB_SERVER_BIND:-0.0.0.0:8080}:8080"
|
|
volumes:
|
|
- shop-data:/app/data
|
|
- ${COMPOSE_BACKUP_SOURCE:-.}:/app/compose-source:${COMPOSE_RESTORE_MODE:-rw}
|
|
networks:
|
|
- remnawave-shop
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=3).read()\""]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
worker:
|
|
image: 3252a8/remnawave-minishop-worker:${IMAGE_TAG:-latest}
|
|
restart: unless-stopped
|
|
env_file: *app_env_file
|
|
environment:
|
|
<<: *app_environment
|
|
volumes:
|
|
- shop-data:/app/data
|
|
- ${COMPOSE_BACKUP_SOURCE:-.}:/app/compose-source:ro
|
|
networks:
|
|
- remnawave-shop
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
|
|
frontend:
|
|
image: 3252a8/remnawave-minishop-frontend:${IMAGE_TAG:-latest}
|
|
restart: unless-stopped
|
|
environment:
|
|
IMAGE_TAG: ${IMAGE_TAG:-latest}
|
|
FRONTEND_PUBLIC: ${MINIAPP_PUBLIC_URL:?set MINIAPP_PUBLIC_URL in .env}
|
|
ports:
|
|
- "${FRONTEND_BIND:-0.0.0.0:8082}:80"
|
|
networks:
|
|
- remnawave-shop
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/health | grep -q ok"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
networks:
|
|
remnawave-shop:
|
|
|
|
volumes:
|
|
postgres-data:
|
|
name: remnawave-minishop-db-data
|
|
redis-data:
|
|
name: remnawave-minishop-redis-data
|
|
shop-data:
|
|
name: remnawave-minishop-shop-data
|