-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
149 lines (139 loc) · 3.2 KB
/
docker-compose.yaml
File metadata and controls
149 lines (139 loc) · 3.2 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: "3.9"
volumes:
appdb-data:
kcx-data:
appx-data:
networks:
appnet:
name: internal
driver: bridge
frontnet:
driver: bridge
services:
dbx:
image: mysql:8.0
container_name: dbx
env_file: [.env]
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: keycloak_db
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_HOST: "%"
volumes:
- appdb-data:/var/lib/mysql
- ./database/mysql-init:/docker-entrypoint-initdb.d
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- appnet
kcx:
build:
context: ./docker/auth/
dockerfile: Dockerfile
image: custom-keycloak:latest
container_name: kcx
command:
- start-dev
- --features=preview
- --proxy=edge
- --import-realm
- --hostname-url=http://${KEYCLOAK_HOST_IP}/keycloak
- --hostname-admin-url=http://${KEYCLOAK_HOST_IP}/keycloak
- --hostname-strict=false
- --hostname-strict-https=false
- --health-enabled=true
- --metrics-enabled=true
ports:
- "8080:8080"
env_file: [.env]
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_DB_USERNAME: ${DB_USER}
KC_DB_PASSWORD: ${DB_PASSWORD}
networks:
- appnet
- frontnet
appx:
container_name: appx
image: ghcr.io/sivanuhappy/classx-app:latest
env_file:
- .env
ports:
- 5001:5000
entrypoint: >
/bin/bash -c "
source /opt/conda/etc/profile.d/conda.sh &&
conda activate ClassXTool &&
export PYTHONPATH=/app &&
sleep 5 &&
gunicorn --workers 10 --threads 12 -b 0.0.0.0:5000 wsgi:app
"
volumes:
- ./app/static:/app/static
depends_on:
dbx:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
networks:
- appnet
- frontnet
worker:
container_name: worker
image: ghcr.io/sivanuhappy/classx-app:latest
env_file:
- .env
entrypoint: >
/bin/bash -c "
source /opt/conda/etc/profile.d/conda.sh &&
conda activate ClassXTool &&
export PYTHONPATH=/app &&
sleep 5 &&
celery -A tasks.celery worker -l info -E --concurrency=2
"
volumes:
- ./app/static:/app/static
depends_on:
appx:
condition: service_started
redis:
condition: service_started
restart: on-failure
networks:
- appnet
- frontnet
redis:
container_name: redis
image: redis:7.2.5
ports:
- "6379:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- appnet
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./config/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "80:80"
depends_on:
- kcx
networks:
- appnet
- frontnet
restart: unless-stopped