-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
89 lines (89 loc) · 2.32 KB
/
docker-compose.prod.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
version: "3.9"
services:
# TODO: Memory overcommit must be enabled! Without it
redis:
image: redis/redis-stack-server:latest
container_name: jarvis-redis
restart: always
ports:
- "6379:6379"
volumes:
- redis-data:/var/lib/redis-stack
env_file:
- .env
command:
- "redis-stack-server"
- "--save 90 1"
- "--save 30 10"
- "--save 6 10000"
- "--requirepass ${REDIS_PASSWORD}"
networks:
- backend
# TODO: update docker image
app:
image: jarvisgptacr.azurecr.io/jarvis_app:v1
container_name: jarvis-api
build: .
restart: always
# vCPU * 1.5
command: uvicorn main:app --proxy-headers --workers 6 --host=0.0.0.0 --port 8080
expose:
- "8080"
ports:
- "8080:8080"
secrets:
- gcp-credentials
env_file:
- .env
depends_on:
- redis
networks:
- backend
# https://velog.io/@fordevelop/Docker-Nginx-Certbot-Lets-Encrypt%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%B4-SSL-%EC%9D%B8%EC%A6%9D%EC%84%9C-%EB%B0%9C%EA%B8%89
nginx:
container_name: jarvis-nginx
image: nginx:1.15-alpine
restart: always
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
ports:
- 80:80
- 443:443
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
networks:
- backend
certbot:
container_name: jarvis-certbot
image: certbot/certbot:v0.36.0
restart: always
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
redis-commander:
container_name: redis-commander
image: rediscommander/redis-commander:latest
restart: always
environment:
REDIS_HOSTS: redis
REDIS_HOST: redis
REDIS_PORT: redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
HTTP_USER: root
HTTP_PASSWORD: ${REDIS_PASSWORD}
URL_PREFIX: /admin
ports:
- "8081:8081"
networks:
- backend
volumes:
redis-data:
driver: local
networks:
backend:
secrets:
gcp-credentials:
file: ./gcp-credentials.json