generated from pierrz/papel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
138 lines (124 loc) · 3.25 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Main compose setup
name: "${PROJECT_NAME}"
##############
# ENV, VOLUMES & NETWORK
x-brif-common: &brif-common
environment: &brif-common-env
BASE_URL: "${BASE_URL}"
APP_SUBDOMAIN: "${APP_SUBDOMAIN}"
APP_PORT: "${APP_PORT}"
SECRET_KEY: "${SECRET_KEY}"
CELERY_BROKER_URL: "${CELERY_BROKER_URL}"
CELERY_RESULT_BACKEND: "${CELERY_RESULT_BACKEND}"
DB_NAME: "${DB_NAME}"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
CANTALOUPE_PORT: "${CANTALOUPE_PORT}"
API_IMAGE_BACKEND: "${API_IMAGE_BACKEND}"
volumes:
- ${DATA_DIR}:/opt/data # change to the project's data location
links:
- "cantaloupe:http"
volumes:
brif_vdb:
name: brif_vdb
brif_vrabbitmq:
name: brif_vrabbitmq
networks:
brif-network:
name: brif_network
driver: bridge
ipam:
config:
# range starts at 172.20 to avoid conflicts with the bridge network (172.17)
- subnet: 172.20.0.0/16
services:
##############
# API SERVICES
api_test:
<<: *brif-common
container_name: brif_api_test
image: brif_api_img
build:
context: .
dockerfile: setup/app/Dockerfile
command: pytest -vv
depends_on:
- cantaloupe
- db
- celery
networks:
brif-network:
ipv4_address: 172.20.0.101
api_prod:
<<: *brif-common
container_name: brif_api_prod
image: brif_api_img
command: uvicorn main:app --host 0.0.0.0 --reload
depends_on:
- api_test
networks:
brif-network:
ipv4_address: 172.20.0.102
#####################
# SUPPORTING SERVICES
cantaloupe:
container_name: brif_cantaloupe
image: brif_cantaloupe
build:
context: .
dockerfile: setup/cantaloupe/Dockerfile
restart: always
volumes:
- ${LOGS_DIR}/cantaloupe:/cantaloupe/logs
# CHANGE WITH CAUTION the mount below as it is tied to cantaloupe/properties
# via FilesystemSource.BasicLookupStrategy.path_prefix
- ${CONTENT_DIR}:/mnt/directories
networks:
brif-network:
ipv4_address: 172.20.0.103
celery:
container_name: brif_celery
image: celery_app_img
build:
context: .
dockerfile: setup/celery/Dockerfile
volumes:
- ${LOGS_DIR}/celery:/opt/celery_app/logs
- ${DATA_DIR}:/opt/data # change to the project's data location
environment:
<<: *brif-common-env
depends_on:
- rabbit-mq
networks:
brif-network:
ipv4_address: 172.20.0.104
rabbit-mq:
container_name: brif_rabbitmq
image: rabbitmq:3.8-management
restart: on-failure
volumes:
- ${LOGS_DIR}/rabbitmq:/var/log/rabbitmq
- brif_vrabbitmq:/var/lib/rabbitmq
networks:
brif-network:
ipv4_address: 172.20.0.105
db:
container_name: brif_db
build:
context: .
dockerfile: setup/postgres/Dockerfile
restart: always
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
DB_NAME: "${DB_NAME}"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
volumes:
- brif_vdb:/var/lib/postgresql/data
- ${LOGS_DIR}/postgres:/var/log/postgresql
networks:
brif-network:
ipv4_address: 172.20.0.106