forked from itudb2319/itudb2319
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
57 lines (53 loc) · 1.22 KB
/
docker-compose.yaml
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
version: '3.7'
services:
app:
build:
context: .
dockerfile: ./app/dockerfile
restart: always
container_name: app
ports:
- "5001:5001"
depends_on:
- database
- rabbitmq
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=${POSTGRES_HOST}
env_file:
- .env
volumes:
- ./app:/project/app
database:
image: "postgres:latest"
restart: always
container_name: database
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
env_file:
- .env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
rabbitmq:
image: "rabbitmq:3-management"
container_name: rabbitmq
hostname: my-rabbit
env_file:
- .env
environment:
- RABBITMQ_USER=${RABBITMQ_USER}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
ports:
- ${RABBITMQ_PORT_1}
- ${RABBITMQ_PORT_2}
volumes:
db-data: