-
Notifications
You must be signed in to change notification settings - Fork 211
/
docker-compose.yml
70 lines (68 loc) · 2.06 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
services:
backend:
env_file:
- .env.dev
build:
context: ./backend
container_name: django_backend
restart: unless-stopped
command: sh -c "python manage.py wait_for_db &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py loaddata fixtures/superuser.json &&
python manage.py loaddata fixtures/status_types.json &&
python manage.py loaddata fixtures/topics.json &&
python manage.py populate_db --users 10 --orgs-per-user 1 --groups-per-org 1 --events-per-org 1 &&
python manage.py runserver 0.0.0.0:${BACKEND_PORT}"
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
environment:
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}
- DEBUG=${DEBUG}
- SECRET_KEY=${SECRET_KEY}
- VITE_FRONTEND_URL=${VITE_FRONTEND_URL}
depends_on:
- db
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${BACKEND_PORT}/health/ || exit 1"]
interval: 10s
timeout: 5s
retries: 5
frontend:
env_file:
- .env.dev
build:
context: ./frontend
container_name: nuxt_frontend
command: sh -c "yarn install && yarn dev --port ${FRONTEND_PORT}"
volumes:
- ./frontend:/app
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
- "24678:24678"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${FRONTEND_PORT}/ || exit 1"]
interval: 10s
timeout: 5s
retries: 5
db:
env_file:
- .env.dev
image: postgres:15
container_name: postgres_db
environment:
- POSTGRES_DB=${DATABASE_NAME}
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
ports:
- "${DATABASE_PORT}:${DATABASE_PORT}"
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DATABASE_USER}"]
interval: 10s
timeout: 5s
retries: 5