-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (100 loc) · 3.56 KB
/
docker-compose.yml
File metadata and controls
108 lines (100 loc) · 3.56 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
# Image registry (set in .env). ECR (build-all.yml): ECR_REGISTRY, ECR_REPOSITORY,
# ANNOTRIEVE_IMAGE_TAG_SEPARATOR=:
# GitLab (legacy default): leave unset or use ANNOTRIEVE_IMAGE_TAG_SEPARATOR=/
x-annotrieve-images:
nginx: &annotrieve-nginx-image >-
${ECR_REGISTRY:-gitlab.hpc.crg.es:5005/monstre}/${ECR_REPOSITORY:-annotrieve}${ANNOTRIEVE_IMAGE_TAG_SEPARATOR:-/}annotrieve-nginx
fastapi: &annotrieve-fastapi-image >-
${ECR_REGISTRY:-gitlab.hpc.crg.es:5005/monstre}/${ECR_REPOSITORY:-annotrieve}${ANNOTRIEVE_IMAGE_TAG_SEPARATOR:-/}annotrieve-fastapi
services:
annotrieve-nginx:
image: *annotrieve-nginx-image
restart: always
environment:
- BASE_PATH=${BASE_PATH}
volumes:
- ${ANNOTATIONS_DATA_PATH}:/data/annotrieve/files:ro
- /data/annotrieve/logs:/var/log/nginx # Shared volume for analytics logs
labels:
- "traefik.enable=true"
- "traefik.http.routers.annotrieve-nginx.rule=(Host(`genome.crg.es`) || Host(`genome.crg.cat`) || Host(`genome.crg.eu`)) && PathPrefix(`/annotrieve`)"
- "traefik.http.routers.annotrieve-nginx.tls=true"
- "traefik.http.routers.annotrieve-nginx.entrypoints=web_https"
- "traefik.http.services.annotrieve-nginx.loadBalancer.server.port=80"
- "traefik.http.middlewares.annotrieve-ratelimit.ratelimit.average=10000"
- "traefik.http.middlewares.annotrieve-ratelimit.ratelimit.period=1m"
- "traefik.http.middlewares.annotrieve-ratelimit.ratelimit.burst=5000"
- "traefik.http.routers.annotrieve-nginx.middlewares=annotrieve-ratelimit"
networks:
- monstre
annotrieve-mongodb:
image: mongo:8.0
container_name: "${DB_HOST}"
env_file:
- .env
restart: always
volumes:
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
- ${MONGODB_DATA_PATH}:/data/db
ports:
- "${MONGODB_PORT:-27030}:27017"
networks:
- monstre
annotrieve-redis:
image: "redis:alpine"
restart: always
expose:
- "6379"
networks:
- monstre
annotrieve-fastapi:
image: *annotrieve-fastapi-image
container_name: annotrieve-fastapi
restart: always
# Production uses Gunicorn (CMD in Dockerfile), override only if needed
volumes:
- ${ANNOTATIONS_DATA_PATH}:${LOCAL_ANNOTATIONS_DIR}
- /data/annotrieve/logs:${LOCAL_LOGS_PATH}:ro # Read-only access to nginx logs for Celery
env_file:
- .env
depends_on:
- annotrieve-redis
- annotrieve-mongodb
expose:
- "5000"
networks:
- monstre
annotrieve-fastapi-celery:
image: *annotrieve-fastapi-image
restart: always
command: celery --app celery_app.celery_worker.app worker --loglevel=info --autoscale=2,1 --max-tasks-per-child=1
volumes:
- ${ANNOTATIONS_DATA_PATH}:${LOCAL_ANNOTATIONS_DIR}
- /data/annotrieve/logs:${LOCAL_LOGS_PATH}:ro # Read-only access to nginx logs
env_file:
- .env
depends_on:
- annotrieve-fastapi
- annotrieve-mongodb
- annotrieve-redis
networks:
- monstre
annotrieve-fastapi-celery-beat:
image: *annotrieve-fastapi-image
restart: always
command: celery --app celery_app.celery_worker.app beat --loglevel=info --schedule=/tmp/celerybeat-schedule
volumes:
- ${ANNOTATIONS_DATA_PATH}:${LOCAL_ANNOTATIONS_DIR}
- /data/annotrieve/logs:${LOCAL_LOGS_PATH}:ro # Read-only access to nginx logs
env_file:
- .env
depends_on:
- annotrieve-fastapi
- annotrieve-mongodb
- annotrieve-redis
networks:
- monstre
networks:
monstre:
external:
name: monstre