Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
154 lines (137 loc) · 3.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
154 lines (137 loc) · 3.74 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:14-alpine
container_name: gavel-postgres
environment:
POSTGRES_DB: gavel
POSTGRES_USER: gavel
POSTGRES_PASSWORD: gavel_dev_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U gavel"]
interval: 5s
timeout: 5s
retries: 5
# Redis for Celery
redis:
image: redis:7-alpine
container_name: gavel-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# HackPSU Auth Service
auth:
build:
context: .
dockerfile: Dockerfile.auth
container_name: gavel-auth
ports:
- "3000:3000"
env_file:
- .env.auth
# Gavel Web Application
web:
build: .
container_name: gavel-web
ports:
- "5001:5001"
environment:
# Database (use container networking)
DATABASE_URL: postgresql://gavel:gavel_dev_password@db:5432/gavel
DB_URI: postgresql://gavel:gavel_dev_password@db:5432/gavel
ADMIN_PASSWORD: adminpassword
# Redis (use container networking)
REDIS_URL: redis://redis:6379/0
BROKER_URI: redis://redis:6379/0
# Flask
SECRET_KEY: dev-secret-key-change-in-production
DEBUG: "true"
# HackPSU Firebase Auth
AUTH_ENVIRONMENT: production
MIN_JUDGE_ROLE: 2
MIN_ADMIN_ROLE: 4
AUTH_SERVER_URL: http://auth:3000/api/sessionUser
AUTH_LOGIN_URL: http://localhost:3000/login
AUTH_LOGOUT_URL: http://auth:3000/api/sessionLogout
GAVEL_URL: http://localhost:5001
PORT: 5001
# Email (disabled for local dev)
DISABLE_EMAIL: "true"
EMAIL_FROM: noreply@localhost
EMAIL_USER: unused
EMAIL_PASSWORD: unused
# Other settings
PROXY: "false"
SEND_STATS: "false"
MIN_VIEWS: 0
TIMEOUT: 5.0
# Project sync from HackPSU API
ENABLE_PROJECT_SYNC: "true"
HACKPSU_API_URL: "https://apiv3.staging.hackpsu.org/judging/projects"
PROJECT_SYNC_INTERVAL: 300 # seconds (5 minutes)
# Optional: the active hackathon is read from the public
# /hackathons/active/static endpoint.
HACKPSU_API_KEY: "${HACKPSU_API_KEY:-}"
# Pin the tenant locally instead of calling the API.
HACKATHON_ID: "${HACKATHON_ID:-local-dev}"
AUTH_CACHE_TTL: 60
# Ignore config file, use env vars
IGNORE_CONFIG_FILE: "true"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./gavel:/app/gavel
- ./static:/app/static
command: >
sh -c "
echo 'Waiting for database...' &&
sleep 2 &&
echo 'Initializing database...' &&
python initialize.py &&
echo 'Starting Gavel...' &&
python runserver.py
"
# Celery Worker (for email tasks, optional for local dev)
celery:
build: .
container_name: gavel-celery
environment:
# Database
DATABASE_URL: postgresql://gavel:gavel_dev_password@db:5432/gavel
DB_URI: postgresql://gavel:gavel_dev_password@db:5432/gavel
# Redis
REDIS_URL: redis://redis:6379/0
BROKER_URI: redis://redis:6379/0
# Flask
SECRET_KEY: dev-secret-key-change-in-production
# Other settings
DISABLE_EMAIL: "true"
IGNORE_CONFIG_FILE: "true"
depends_on:
- db
- redis
- web
volumes:
- ./gavel:/app/gavel
command: celery -A gavel:celery worker --loglevel=info
volumes:
postgres_data:
redis_data:
networks:
default:
name: gavel-network
driver: bridge