-
Notifications
You must be signed in to change notification settings - Fork 37
/
docker-compose-backend.yml
115 lines (107 loc) · 2.49 KB
/
docker-compose-backend.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
version: "3.7"
services:
postgres:
image: postgis/postgis:15-3.4-alpine
container_name: pc-postgres
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
- env_file
networks:
- db_nw
ports:
- 5434:5432 # This port is used outside docker compose network (E2E tests and developers launching flask api on their local machines)
command: postgres -c logging_collector=on -c log_destination=stderr -c log_min_duration_statement=0 -c log_statement=all -c log_duration=on
postgres-test:
image: postgis/postgis:15-3.4-alpine
container_name: pc-postgres-pytest
volumes:
- postgres_data_test:/var/lib/postgresql-test/data
environment:
- POSTGRES_DB=pass_culture
- POSTGRES_USER=pytest
- POSTGRES_PASSWORD=pytest
command: postgres -c logging_collector=on -c log_destination=stderr -c log_min_duration_statement=0 -c log_statement=all -c log_duration=on
ports:
- 5433:5432
networks:
- db_nw
flask:
build:
context: ./api
target: api-flask
working_dir: /usr/src/app
container_name: pc-api
command: [ "./start-api-when-database-is-ready.sh" ]
volumes:
- ./api:/usr/src/app
env_file:
- env_file
networks:
- db_nw
- web_nw
depends_on:
- postgres
- redis
- postgres-test
ports:
- 5001:5001
- 10002:10002 # debugger port
stdin_open: true
tty: true
backoffice:
build:
context: ./api
target: api-flask
working_dir: /usr/src/app
container_name: pc-backoffice
command: [ "./start-backoffice-when-api-is-ready.sh" ]
volumes:
- ./api:/usr/src/app
env_file:
- env_file
networks:
- db_nw
- web_nw
depends_on:
- postgres
- redis
- postgres-test
ports:
- 5002:5001
- 10004:10003 # debugger port
stdin_open: true
tty: true
redis:
image: scalingo/redis
container_name: pc-redis
command: redis-server
ports:
- 6379:6379
volumes:
- redis_data:/data
networks:
- db_nw
nginx:
build: nginx
container_name: pc-nginx
ports:
- 80:80
- 443:443
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./certs:/etc/letsencrypt
- ./certs-data:/data/letsencrypt
networks:
- web_nw
depends_on:
- flask
networks:
db_nw:
driver: bridge
web_nw:
driver: bridge
volumes:
postgres_data:
postgres_data_test:
redis_data: