-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (162 loc) · 5.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
170 lines (162 loc) · 5.72 KB
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
158
159
160
161
162
163
164
165
166
167
168
169
170
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: migration
POSTGRES_USER: postgres
POSTGRES_PASSWORD: thos
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
storage:
image: minio/minio:RELEASE.2024-09-22T00-33-43Z
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: gaudeix
MINIO_ROOT_PASSWORD: gaudeixsecret
volumes:
- storage_data:/data
ports:
- "9000:9000"
- "9001:9001"
redis:
image: redis:7-alpine
ports:
- "6379:6379"
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- ./backend/.env.docker.example
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:thos@db:5432/migration}
DB_ENGINE: ${DB_ENGINE:-django.db.backends.postgresql}
DB_NAME: ${DB_NAME:-migration}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-thos}
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-backend,localhost,127.0.0.1}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-dev-secret-key}
ENVIRONMENT: ${ENVIRONMENT:-production}
DJANGO_ALLOWED_CORS_ORIGINS: ${DJANGO_ALLOWED_CORS_ORIGINS:-http://localhost:4173,http://localhost:4174,http://127.0.0.1:4173,http://127.0.0.1:4174,http://localhost:5173,http://localhost:5174,http://127.0.0.1:5173,http://127.0.0.1:5174}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
storage:
condition: service_started
redis:
condition: service_started
worker:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- ./backend/.env.docker.example
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:thos@db:5432/migration}
DB_ENGINE: ${DB_ENGINE:-django.db.backends.postgresql}
DB_NAME: ${DB_NAME:-migration}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-thos}
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-backend,localhost,127.0.0.1}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-dev-secret-key}
ENVIRONMENT: ${ENVIRONMENT:-production}
DJANGO_ALLOWED_CORS_ORIGINS: ${DJANGO_ALLOWED_CORS_ORIGINS:-http://localhost:4173,http://localhost:4174,http://127.0.0.1:4173,http://127.0.0.1:4174,http://localhost:5173,http://localhost:5174,http://127.0.0.1:5173,http://127.0.0.1:5174}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
command: ["celery", "-A", "config", "worker", "--loglevel=info"]
healthcheck:
disable: true
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
beat:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- ./backend/.env.docker.example
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:thos@db:5432/migration}
DB_ENGINE: ${DB_ENGINE:-django.db.backends.postgresql}
DB_NAME: ${DB_NAME:-migration}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-thos}
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-backend,localhost,127.0.0.1}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-dev-secret-key}
ENVIRONMENT: ${ENVIRONMENT:-production}
DJANGO_ALLOWED_CORS_ORIGINS: ${DJANGO_ALLOWED_CORS_ORIGINS:-http://localhost:4173,http://localhost:4174,http://127.0.0.1:4173,http://127.0.0.1:4174,http://localhost:5173,http://localhost:5174,http://127.0.0.1:5173,http://127.0.0.1:5174}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
command: ["celery", "-A", "config", "beat", "--loglevel=info"]
healthcheck:
disable: true
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
env_file:
- ./frontend/.env.local.example
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8000/api/v1}
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
ports:
- "4173:4173"
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
command: ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "4173"]
depends_on:
- backend
backoffice:
build:
context: .
dockerfile: backoffice/Dockerfile
env_file:
- ./backoffice/.env.local.example
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8000/api/v1}
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
ports:
- "4174:4174"
volumes:
- ./backoffice:/app/backoffice
- ./frontend/src:/app/frontend/src
- backoffice_node_modules:/app/backoffice/node_modules
working_dir: /app/backoffice
command: ["sh", "-lc", "test -d node_modules/cross-env || npm install && npm run dev -- --host 0.0.0.0 --port 4174"]
depends_on:
- backend
volumes:
postgres_data:
storage_data:
frontend_node_modules:
backoffice_node_modules: