-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.app.yml
More file actions
90 lines (85 loc) · 2.74 KB
/
docker-compose.app.yml
File metadata and controls
90 lines (85 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 应用服务: Backend, Frontend, Nginx
# 使用: ./bin/control app up
# 前置条件: infra 服务必须已启动
services:
# Backend Application
backend:
image: ${DOCKER_REGISTRY:-docker.io}/${DOCKER_ORG:-umuoy1}/${IMAGE_PREFIX:-streamerhelper}-backend:${BACKEND_VERSION:-latest}
container_name: streamer-backend
restart: unless-stopped
environment:
NODE_ENV: production
TZ: ${TZ:-Asia/Shanghai}
MIDWAY_LOGGER_WRITEABLE_DIR: /app
LOG_DIR: /app/logs
# App
APP_PORT: ${APP_PORT:-7001}
APP_KEYS: ${APP_KEYS:-streamer-helper-secret-key}
# Database
TYPEORM_HOST: ${TYPEORM_HOST:-postgres}
TYPEORM_PORT: ${TYPEORM_PORT:-5432}
TYPEORM_USERNAME: ${TYPEORM_USERNAME:-postgres}
TYPEORM_PASSWORD: ${TYPEORM_PASSWORD:-postgres}
TYPEORM_DATABASE: ${TYPEORM_DATABASE:-streamerhelper}
# Redis
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
# S3/MinIO
S3_ENDPOINT: ${S3_ENDPOINT:-http://minio:7090}
S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-http://localhost:7090}
S3_REGION: ${S3_REGION:-us-east-1}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-minioadmin}
S3_SECRET_KEY: ${S3_SECRET_KEY:-minioadmin}
S3_BUCKET: ${S3_BUCKET:-streamerhelper-archive}
volumes:
- ${CONFIG_DIR:-~/.streamer-helper}/settings.json:/app/config/settings.json:ro
- ${CONFIG_DIR:-~/.streamer-helper}/Logs/backend:/app/logs
- backend_temp:/app/temp
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "${APP_PORT:-7001}"]
interval: 10s
timeout: 10s
start_period: 60s
retries: 5
networks:
- streamer-network
# Frontend Application
frontend:
image: ${DOCKER_REGISTRY:-docker.io}/${DOCKER_ORG:-umuoy1}/${IMAGE_PREFIX:-streamerhelper}-frontend:${FRONTEND_VERSION:-latest}
container_name: streamer-frontend
restart: unless-stopped
environment:
NODE_ENV: production
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider \"http://$$(hostname):3000/\""]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
networks:
- streamer-network
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
container_name: streamer-nginx
restart: unless-stopped
ports:
- "${HTTP_PORT:-7080}:80"
- "${HTTPS_PORT:-7443}:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ${CONFIG_DIR:-~/.streamer-helper}/Logs/nginx:/var/log/nginx
depends_on:
- frontend
- backend
networks:
- streamer-network
networks:
streamer-network:
external: true
volumes:
backend_temp: