-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
101 lines (94 loc) · 2.39 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
version: "3"
services:
# Сервер с хранилищем файлов.
s3:
image: minio/minio:latest
container_name: miniodocker2
command: server /data
ports:
- "9000:9000"
volumes:
- media:/data
environment:
- MINIO_ACCESS_KEY=9QO0C55OGEG79FWQGCGW
- MINIO_SECRET_KEY=S00ICE545g3M8b9RqM2xCNFuGlU6wKy2rkVJAz5y
restart: on-failure
# База
mongo:
image: bitnami/mongodb:latest
container_name: mongo_docker_2
restart: always
# Postfix для отправки почты
postfix:
image: catatnight/postfix
container_name: postfix_docker
environment:
- maildomain=localhost
- smtp_user=user:password
# Наше приложение для отправки почты
postfix_backend:
container_name: postfix_backend_docker_2
build:
dockerfile: Dockerfile
context: ./postfix_application
depends_on:
- postfix
# links можно не писать
links:
- postfix
environment:
- SMTP_HOST=postfix
- SMTP_PORT=25
- SMTP_USER=user
- SMTP_PASSWORD=password
- EMAIL_SERVICE_PORT=5000
restart: "no"
# Наше приложение.
backend:
container_name: backend_docker_2
build:
dockerfile: Dockerfile
context: ./application
depends_on:
- s3
- mongo
- postfix_backend
# links можно не писать
links:
- s3
- mongo
- postfix_backend
environment:
- MINIO_HOST=s3
- MINIO_PORT=9000
- MINIO_ACCESS_KEY=9QO0C55OGEG79FWQGCGW
- MINIO_SECRET_KEY=S00ICE545g3M8b9RqM2xCNFuGlU6wKy2rkVJAz5y
- MINIO_BUCKET_NAME=bucket
- MONGO_HOST=mongo
- MONGO_PORT=27017
- MONGO_DATABASE=mongo
- EMAIL_SERVICE_HOST=postfix_backend
- EMAIL_SERVICE_PORT=5000
- BACKEND_PORT=5000
restart: "no"
# Веб сервер как морда
nginx:
container_name: nginx_docker_2
build:
context: ./nginx
dockerfile: Dockerfile
environment:
- BACKEND_HOST=backend
- BACKEND_PORT=5000
depends_on:
- backend
ports:
- "8000:80"
restart: "no"
volumes:
media:
driver_opts:
type: none
# NOTE: обязательно писать полный путь. С ~ не работает
device: /Users/amnisia/projects/docker_less/docker-compose/media
o: bind