forked from CERT-Polska/mailgoose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (64 loc) · 1.57 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
version: "3"
x-common-configuration:
&common-configuration
restart: always
dns:
- 8.8.8.8
- 8.8.4.4
services:
app:
build:
context: .
dockerfile: app/docker/Dockerfile
environment:
DB_URL: postgresql+psycopg2://postgres:postgres@db:5432/mailgoose
FORWARDED_ALLOW_IPS: "*"
REDIS_URL: redis://redis:6379/0
env_file:
- .env
command: bash -c "/wait-for-it.sh db:5432 -- uvicorn src.app:app --host 0.0.0.0 --port 8000 --proxy-headers --workers 8"
ports:
- 8000:8000
<<: *common-configuration
worker:
build:
context: .
dockerfile: app/docker/Dockerfile
environment:
DB_URL: postgresql+psycopg2://postgres:postgres@db:5432/mailgoose
REDIS_URL: redis://redis:6379/0
env_file:
- .env
command: bash -c "/wait-for-it.sh db:5432 -- rq worker"
<<: *common-configuration
mail_receiver:
build:
context: .
dockerfile: mail_receiver/Dockerfile
command: python3 /opt/server.py
environment:
DB_URL: postgresql+psycopg2://postgres:postgres@db:5432/mailgoose
REDIS_URL: redis://redis:6379/0
env_file:
- .env
ports:
- 25:25
- 587:587
<<: *common-configuration
db:
image: postgres:15.2-alpine
environment:
- POSTGRES_DB=mailgoose
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- data-db:/var/lib/postgresql/data
<<: *common-configuration
redis:
image: redis
volumes:
- data-redis:/data
<<: *common-configuration
volumes:
data-db:
data-redis: