-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcompose.yaml
154 lines (146 loc) · 4.18 KB
/
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
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
services:
trak:
container_name: trak
restart: unless-stopped
image: haztrak-server
build:
context: ./server
ports:
- "8000:8000"
volumes:
- ./server:/app
environment:
DJANGO_SETTINGS_MODULE: "haztrak.settings.dev"
HT_HOST: ${HT_HOST}
HT_SECRET_KEY: ${HT_SECRET_KEY}
HT_DEBUG: ${HT_DEBUG}
HT_LOG_LEVEL: ${HT_LOG_LEVEL}
HT_TIMEZONE: ${HT_TIMEZONE}
HT_RCRAINFO_ENV: ${HT_RCRAINFO_ENV}
HT_CORS_DOMAIN: ${HT_CORS_DOMAIN}
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
HT_CACHE_URL: ${HT_CACHE_URL}
HT_DB_ENGINE: ${HT_DB_ENGINE}
HT_DB_NAME: ${HT_DB_NAME}
HT_DB_USER: ${HT_DB_USER}
HT_DB_PASSWORD: ${HT_DB_PASSWORD}
HT_DB_HOST: db
HT_DB_PORT: ${HT_DB_PORT}
labels:
- "traefik.enable=true"
- "traefik.http.routers.trak.rule=Host(`${HT_HOST}`)"
- "traefik.http.routers.trak.rule=PathPrefix(`/api`) || PathPrefix(`/admin`) || PathPrefix(`/static`) || PathPrefix(`/media`)"
- "traefik.http.routers.trak.entrypoints=web"
command: |
sh -c "
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py loaddata core_dev.yaml rcrasite_dev.yaml org_dev.yaml profile_dev.yaml &&
python manage.py runserver 0.0.0.0:8000"
depends_on:
db:
condition: service_healthy
redis:
container_name: redis
image: "redis:alpine"
ports:
- "6379:6379"
volumes:
- imdb:/data
celery-worker:
restart: unless-stopped
container_name: celery-worker
image: haztrak-server
volumes:
- ./server:/app
environment:
DJANGO_SETTINGS_MODULE: "haztrak.settings.dev"
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
CELERY_LOG_LEVEL: ${CELERY_LOG_LEVEL}
HT_RCRAINFO_ENV: ${HT_RCRAINFO_ENV}
HT_DB_ENGINE: ${HT_DB_ENGINE}
HT_DB_NAME: ${HT_DB_NAME}
HT_DB_USER: ${HT_DB_USER}
HT_DB_PASSWORD: ${HT_DB_PASSWORD}
HT_DB_HOST: db
HT_DB_PORT: ${HT_DB_PORT}
command: python manage.py celery_worker
celery-beat:
restart: unless-stopped
container_name: celery-beat
image: haztrak-server
volumes:
- ./server:/app
environment:
DJANGO_SETTINGS_MODULE: "haztrak.settings.dev"
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
CELERY_LOG_LEVEL: ${CELERY_LOG_LEVEL}
HT_RCRAINFO_ENV: ${HT_RCRAINFO_ENV}
HT_DB_ENGINE: ${HT_DB_ENGINE}
HT_DB_NAME: ${HT_DB_NAME}
HT_DB_USER: ${HT_DB_USER}
HT_DB_PASSWORD: ${HT_DB_PASSWORD}
HT_DB_HOST: db
HT_DB_PORT: ${HT_DB_PORT}
command: python manage.py celery_beat
db:
restart: unless-stopped
container_name: db
image: "postgres:16"
environment:
POSTGRES_DB: ${HT_DB_NAME}
POSTGRES_USER: ${HT_DB_USER}
POSTGRES_PASSWORD: ${HT_DB_PASSWORD}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $HT_DB_USER -d $HT_DB_NAME"]
interval: 3s
timeout: 3s
retries: 5
volumes:
- rdb:/var/lib/postgresql/data
client:
container_name: ht-client
build:
context: ./client
target: dev
ports:
- "3000:3000"
volumes:
- ./client:/app
environment:
VITE_HT_API_URL: ${VITE_HT_API_URL}
VITE_HT_ENV: ${VITE_HT_ENV}
VITE_GITHUB_URL: ${VITE_GITHUB_URL}
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.rule=Host(`${HT_HOST}`)"
- "traefik.http.routers.client.entrypoints=web"
command: sh -c "cd /app; npm install; npm start"
proxy:
image: traefik:v3.1
container_name: proxy
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--log.level=DEBUG"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "8080:8080"
- "80:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
mail:
container_name: mail
image: schickling/mailcatcher
ports:
- "1080:1080"
- "1025:1025"
volumes:
rdb:
imdb: