-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal.yml
127 lines (118 loc) · 3.21 KB
/
local.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
version: "3.9" #deprecated Compose doesn't use version to select an exact schema to validate the Compose file, but prefers the most recent schema when it's implemented.
# A service is an abstract definition of a computing resource within an application which can be scaled or replaced independently from other components.
services:
api:
build:
context: .
dockerfile: ./docker/local/django/Dockerfile
volumes:
- .:/app:z
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
expose:
# expose: Exposes a port within the Docker network, making it accessible to other containers on the same network but not to the host machine. It is a way of declaring that the container listens on a specific port but does not publish this port to the host machine.
# ports: Maps a port on the host machine to a port on the container. This makes the container's service accessible from outside the Docker environment on the specified host port.
- "8000"
env_file:
- ./.envs/.local/.django
- ./.envs/.local/.postgres
depends_on:
postgres:
condition: service_healthy
mailhog:
condition: service_started
redis:
condition: service_started
command: /start
networks:
- authors-api
postgres:
build:
context: .
dockerfile: ./docker/local/postgres/Dockerfile
volumes:
- local_postgres_data:/var/lib/postgresql/data
- local_postgres_data_backups:/backups
env_file:
- ./.envs/.local/.postgres
networks:
- authors-api
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U gardener -d gardening-consultant-live"]
interval: 10s
timeout: 5s
retries: 5
mailhog:
platform: linux/amd64
image: mailhog/mailhog:v1.0.0
container_name: mailhog
ports:
- "8025:8025"
networks:
- authors-api
redis:
platform: linux/amd64
image: redis:7-alpine
networks:
- authors-api
celery_worker:
build:
context: .
dockerfile: ./docker/local/django/Dockerfile
command: /start-celeryworker
volumes:
- .:/app
env_file:
- ./.envs/.local/.django
- ./.envs/.local/.postgres
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- authors-api
flower:
build:
context: .
dockerfile: ./docker/local/django/Dockerfile
command: /start-flower
volumes:
- flower_data:/data
env_file:
- ./.envs/.local/.django
- ./.envs/.local/.postgres
ports:
- "5555:5555"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- authors-api
nginx:
restart: always
depends_on:
- api
volumes:
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
build:
context: ./docker/local/nginx
dockerfile: Dockerfile
ports:
- "8080:80"
networks:
- authors-api
networks:
authors-api:
driver: bridge
volumes:
static_volume:
media_volume:
local_postgres_data: {}
local_postgres_data_backups: {}
flower_data: {}