-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (106 loc) · 3.32 KB
/
Copy pathdocker-compose.yml
File metadata and controls
111 lines (106 loc) · 3.32 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
services:
db:
image: postgres:15-alpine
container_name: reuse_iteso_db
environment:
POSTGRES_DB: reuse_iteso_dev
POSTGRES_USER: reuse_dev
POSTGRES_PASSWORD: local_dev_password
TZ: America/Mexico_City
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- reuse_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U reuse_dev -d reuse_iteso_dev"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: reuse_iteso_backend
environment:
SECRET_KEY: "${SECRET_KEY:-django-insecure-dev-key-change-in-production}"
DEBUG: "${DEBUG:-True}"
ALLOWED_HOSTS: "${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,backend}"
DB_NAME: "${DB_NAME:-reuse_iteso_dev}"
DB_USER: "${DB_USER:-reuse_dev}"
DB_PASSWORD: "${DB_PASSWORD:-local_dev_password}"
DB_HOST: "${DB_HOST:-db}"
DB_PORT: "${DB_PORT:-5432}"
CORS_ALLOWED_ORIGINS: "${CORS_ALLOWED_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}"
FRONTEND_BASE_URL: "${FRONTEND_BASE_URL:-http://localhost:3000}"
EMAIL_HOST: "${EMAIL_HOST:-smtp.sendgrid.net}"
EMAIL_PORT: "${EMAIL_PORT:-587}"
EMAIL_USE_TLS: "${EMAIL_USE_TLS:-True}"
EMAIL_HOST_USER: "${EMAIL_HOST_USER:-apikey}"
EMAIL_HOST_PASSWORD: "${SENDGRID_API_KEY:-}"
DEFAULT_FROM_EMAIL: "${DEFAULT_FROM_EMAIL:-reuseiteso@outlook.com}"
EMAIL_VERIFICATION_EXPIRES_MINUTES: "${EMAIL_VERIFICATION_EXPIRES_MINUTES:-30}"
MICROSOFT_CLIENT_ID: "${MICROSOFT_CLIENT_ID:-}"
MICROSOFT_CLIENT_SECRET: "${MICROSOFT_CLIENT_SECRET:-}"
MICROSOFT_TENANT_ID: "${MICROSOFT_TENANT_ID:-common}"
MICROSOFT_REDIRECT_URI: "${MICROSOFT_REDIRECT_URI:-http://localhost:3000/auth/microsoft/callback}"
ports:
- "8000:8000"
volumes:
- ./backend:/app
- /app/.venv # This "hides" the container's version from your host's version
- /app/__pycache__ # Prevents cache conflicts
- ./backend/media:/app/media # Maps local media directly to container root /media
working_dir: /app
depends_on:
db:
condition: service_healthy
networks:
- reuse_network
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: "${NEXT_PUBLIC_API_URL:-http://localhost:8000/api}"
container_name: reuse_iteso_frontend
environment:
WATCHPACK_POLLING: true
NEXT_PUBLIC_API_URL: "${NEXT_PUBLIC_API_URL:-http://localhost:8000/api}"
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
command: npm run dev # This triggers nodemon/next dev
depends_on:
- backend
networks:
- reuse_network
restart: unless-stopped
adminer:
image: adminer:latest
container_name: reuse_iteso_adminer
ports:
- "8080:8080"
networks:
- reuse_network
depends_on:
- db
restart: unless-stopped
environment:
ADMINER_DEFAULT_SERVER: db
ADMINER_DESIGN: pepa-linha
volumes:
postgres_data:
driver: local
media_volume:
driver: local
networks:
reuse_network:
driver: bridge