-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
89 lines (84 loc) · 2.19 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
services:
app:
build:
context: .
target: ${BUILD_TARGET:-main}
command: /code/.venv/bin/fastapi run app/main.py --port 8080 --proxy-headers
env_file: ${APP_VOLUME_PATH:-.}/.env
volumes:
- static_volume:/code/static
- ${APP_VOLUME_PATH:-/tmp}/app-logs:/code/logs
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --spider --quiet http://0.0.0.0:8080 || exit 1"]
interval: 5s
timeout: 5s
worker:
build:
context: .
target: ${BUILD_TARGET:-main}
command: crond -f
env_file: ${APP_VOLUME_PATH:-.}/.env
volumes:
- ${APP_VOLUME_PATH:-/tmp}/worker-logs:/code/logs
depends_on:
redis:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.80'
healthcheck:
test: ["CMD-SHELL", "ps aux | grep -i crond | grep -wv grep || exit 1"]
interval: 5s
timeout: 2s
redis:
build:
context: ./build/redis
command: sh -c "./init.sh"
# Run as privileged to allow the container to change the vm.overcommit_memory setting
privileged: true
volumes:
- ${APP_VOLUME_PATH}/redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 2s
nginx:
build:
context: ./build/nginx
ports:
- "${APP_PORT}:80"
entrypoint: ["/entrypoint.sh"]
env_file: ${APP_VOLUME_PATH:-.}/.env
volumes:
- static_volume:/static
depends_on:
app:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --spider --quiet http://localhost || exit 1"]
interval: 5s
timeout: 2s
reverse-proxy:
profiles:
- testing
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./build/reverse-proxy/default.conf:/etc/nginx/conf.d/default.conf
- ./build/reverse-proxy/nginx.conf:/etc/nginx/nginx.conf
depends_on:
nginx:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget --spider --quiet http://localhost || exit 1"]
interval: 5s
timeout: 2s
volumes:
static_volume: