-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
157 lines (148 loc) · 3.59 KB
/
docker-compose.dev.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: "3.9"
services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
image: localstack/localstack
ports:
- "4566:4566" # LocalStack Gateway
- "4510-4559:4510-4559" # external services port range
environment:
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
- DEBUG=${DEBUG:-0}
- AWS_BUCKET_NAME=${AWS_BUCKET_NAME}
volumes:
- "./scripts/dev/aws:/etc/localstack/init/ready.d"
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- media-api-net
- base-api-net
redis:
image: redis
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
networks:
media-api-net:
aliases:
- ${REDIS_HOST}
base-api-net:
aliases:
- ${REDIS_HOST}
postgres:
image: postgres
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
expose:
- ${DB_PORT}
networks:
base-api-net:
aliases:
- ${DB_HOST}
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_NAME}'"]
interval: 1m30s
start_interval: 10s
timeout: 30s
retries: 5
start_period: 5s
restart: unless-stopped
django-celery-worker:
build:
context: ./backend
dockerfile: ./Dockerfile
target: dev
entrypoint: ["sh", "./scripts/start-dev-celery.sh"]
init: true
volumes:
- ./backend/app:/app
networks:
- base-api-net
env_file:
- .env
restart: unless-stopped
depends_on:
localstack:
condition: service_healthy
redis:
condition: service_started
postgres:
condition: service_healthy
django-api:
build:
context: ./backend
target: dev
init: true
ports:
- "${DJANGO_PORT}:${DJANGO_PORT}"
volumes:
- ./backend/app:/app
networks:
base-api-net:
aliases:
- ${DJANGO_HOST}
public-net:
env_file:
- .env
restart: unless-stopped
depends_on:
django-celery-worker:
condition: service_started
media-api:
build:
context: ./media_api
target: dev
init: true
ports:
- "${MEDIA_PORT}:${MEDIA_PORT}"
volumes:
- ./media_api/app:/app/src
networks:
media-api-net:
aliases:
- ${MEDIA_HOST}
public-net:
env_file:
- .env
restart: unless-stopped
depends_on:
localstack:
condition: service_healthy
redis:
condition: service_started
webserver:
build:
context: ./frontend
target: dev
init: true
tty: true
ports:
- "${WEB_PORT}:${WEB_PORT}"
volumes:
- ./frontend:/usr/src/app
- node-modules:/usr/src/app/node_modules
networks:
- public-net
environment:
- WEB_PORT=${WEB_PORT}
- WEB_HOST=0.0.0.0
- DJANGO_HOST=${DJANGO_HOST}
- DJANGO_PORT=${DJANGO_PORT}
- MEDIA_HOST=${MEDIA_HOST}
- MEDIA_PORT=${MEDIA_PORT}
- VITE_API_CSRF_COOKIE_KEY=${API_CSRF_COOKIE_KEY}
- VITE_API_CSRF_HEADER_NAME=${API_CSRF_HEADER_NAME}
restart: unless-stopped
depends_on:
- django-api
- media-api
volumes:
pgdata:
node-modules:
networks:
base-api-net:
media-api-net:
public-net: