docs: update deploy examples
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
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: https://${WEBHOOK_HOST:?set WEBHOOK_HOST in .env}
|
||||
SUBSCRIPTION_MINI_APP_URL: https://${MINIAPP_HOST:?set MINIAPP_HOST 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: ghcr.io/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: ghcr.io/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,172.16.0.0/12}
|
||||
volumes:
|
||||
- shop-data:/app/data
|
||||
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: ghcr.io/3252a8/remnawave-minishop-worker:${IMAGE_TAG:-latest}
|
||||
restart: unless-stopped
|
||||
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
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
|
||||
frontend:
|
||||
image: ghcr.io/3252a8/remnawave-minishop-frontend:${IMAGE_TAG:-latest}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
IMAGE_TAG: ${IMAGE_TAG:-latest}
|
||||
FRONTEND_PUBLIC: https://${MINIAPP_HOST:?set MINIAPP_HOST in .env}/
|
||||
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
|
||||
|
||||
caddy:
|
||||
image: caddy:2-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
WEBHOOK_HOST: ${WEBHOOK_HOST:?set WEBHOOK_HOST in .env}
|
||||
MINIAPP_HOST: ${MINIAPP_HOST:?set MINIAPP_HOST in .env}
|
||||
ports:
|
||||
- "${HTTP_BIND:-0.0.0.0:80}:80"
|
||||
- "${HTTPS_BIND:-0.0.0.0:443}:443"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- caddy-data:/data
|
||||
- caddy-config:/config
|
||||
networks:
|
||||
- remnawave-shop
|
||||
depends_on:
|
||||
frontend:
|
||||
condition: service_healthy
|
||||
backend:
|
||||
condition: service_healthy
|
||||
|
||||
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
|
||||
caddy-data:
|
||||
name: remnawave-minishop-caddy-data
|
||||
caddy-config:
|
||||
name: remnawave-minishop-caddy-config
|
||||
Reference in New Issue
Block a user