forked from betagouv/preuve-covoiturage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
142 lines (133 loc) · 2.81 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
139
140
141
142
version: '3.5'
services:
postgres:
build:
context: ./docker/postgres
shm_size: 2g
ports:
- 5432:5432
networks:
- back
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'postgres'
POSTGRES_DB: 'local'
PGDATA: '/var/lib/postgresql/data/pgdata'
command: ["postgres", "-c", "log_statement=all"]
volumes:
- ./db/postgres:/var/lib/postgresql/data/pgdata
redis:
build: './docker/redis'
ports:
- 6379:6379
networks:
- back
mailer:
image: mailhog/mailhog:v1.0.1
environment:
MH_CORS_ORIGIN: '*'
ports:
- 8025:8025
- 1025:1025
networks:
- back
s3:
image: minio/minio
environment:
- MINIO_ROOT_USER=admin
- MINIO_ROOT_PASSWORD=admin789456123
networks:
- back
command: 'server /data --console-address ":9001"'
volumes:
- ./db/s3:/data
ports:
- 9000:9000
- 9001:9001
api:
build:
dockerfile: ./docker/api/Dockerfile
context: .
volumes:
- ./api:/app/api
- ./shared:/app/shared:ro
- ./tmp:/tmp
command: 'sh -c "pm2-runtime start pm2-api.json | pino-pretty"'
tty: true
env_file: ./api/.env
environment:
PORT: 8080
APP_RATE_LIMIT_MAX_FACTOR: '0'
ports:
- 8080:8080
networks:
- back
depends_on:
- redis
- postgres
- mailer
- s3
worker:
build:
dockerfile: ./docker/api/Dockerfile
context: .
deploy:
mode: replicated
replicas: 3
volumes:
- ./api:/app/api
- ./shared:/app/shared:ro
- ./tmp:/tmp
command: 'sh -c "pm2-runtime start pm2-worker.json | pino-pretty"'
tty: true
env_file: ./api/.env
environment:
APP_WORKER: 'true'
APP_RATE_LIMIT_MAX_FACTOR: '0'
APP_REQUEST_TIMEOUT: '0'
APP_POSTGRES_TIMEOUT: '0'
# TODO
# AWS_ACCESS_KEY_ID: minioadmin
# AWS_SECRET_ACCESS_KEY: minioadmin
# AWS_ENDPOINT: http://s3:9000/minio
# AWS_REGION:
networks:
- back
depends_on:
- redis
- postgres
- mailer
# - s3
migrator:
build:
dockerfile: ./docker/api/Dockerfile
context: .
volumes:
- ./api:/app/api:ro
working_dir: /app/api
command: 'yarn migrate'
tty: true
env_file: ./api/.env
networks:
- back
dashboard:
build:
dockerfile: ./docker/dashboard/Dockerfile
context: .
volumes:
- ./dashboard:/app/dashboard
- ./docker/dashboard/dev.env.js:/app/dashboard/src/assets/env.js:ro
- ./shared:/app/shared:ro
tty: true
ports:
- 4200:4200
depends_on:
- api
lint:
build: './docker/lint'
tty: true
volumes:
- ./api:/code/api:ro
- ./dashboard:/code/dashboard:ro
networks:
back: