-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathdocker-compose.yml
117 lines (112 loc) · 2.88 KB
/
docker-compose.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
networks:
net:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.196.0/24
services:
nginx:
image: registry.cn-beijing.aliyuncs.com/nineaiyu/nginx:1.24-bullseye
container_name: xadmin-nginx
restart: always
volumes:
- ./utils/nginx.conf:/etc/nginx/nginx.conf:r
- ./data/logs:/var/log/nginx
ports:
- "8896:8896"
networks:
- net
postgresql:
image: registry.cn-beijing.aliyuncs.com/nineaiyu/postgres:16.5
container_name: xadmin-postgresql
restart: always
command: [ "postgres","-c","max_connections=8000" ]
environment:
TZ: ${TZ:-Asia/Shanghai}
POSTGRES_DB: ${DB_DATABASE:-xadmin}
POSTGRES_USER: ${DB_USER:-server}
POSTGRES_PASSWORD: ${DB_PASSWORD:-KGzKjZpWBp4R4RSa}
volumes:
- ${VOLUME_DIR:-../}/xadmin-postgresql/data:/var/lib/postgresql/data
healthcheck:
test: "pg_isready -q -U $$POSTGRES_USER -d $$POSTGRES_DB"
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
networks:
- net
redis:
image: registry.cn-beijing.aliyuncs.com/nineaiyu/redis:7.4.1
container_name: xadmin-redis
hostname: xadmin-redis
restart: always
command: [ "redis-server", "--requirepass", "${REDIS_PASSWORD:-nineven}", "--port", "${REDIS_PORT:-6379}" ]
environment:
TZ: ${TZ:-Asia/Shanghai}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASSWORD: ${REDIS_PASSWORD:-nineven}
volumes:
- ${VOLUME_DIR:-../}/xadmin-redis/data:/data
healthcheck:
test: "redis-cli -h 127.0.0.1 -p $$REDIS_PORT -a $$REDIS_PASSWORD info Replication"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
- net
server:
image: xadmin-server
container_name: xadmin-server
hostname: xadmin-server
build:
context: .
dockerfile: Dockerfile-dev
ulimits:
core: 0
restart: always
privileged: true
command: start web
volumes:
- ./:/data/xadmin-server
# - ${VOLUME_DIR:-.}/server/data:/data/xadmin-server/data
healthcheck:
test: "curl -fsL http://localhost:8896/api/common/api/health > /dev/null"
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
depends_on:
- nginx
- postgresql
- redis
networks:
- net
celery:
image: xadmin-server
container_name: xadmin-celery
hostname: xadmin-celery
build:
context: .
dockerfile: Dockerfile-dev
ulimits:
core: 0
restart: always
privileged: true
command: start task
volumes:
- ./:/data/xadmin-server
# - ${VOLUME_DIR:-.}/server/data:/data/xadmin-server/data
healthcheck:
test: "bash utils/check_celery.sh"
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
depends_on:
- postgresql
- redis
networks:
- net