Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.87 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
# StackRadar — Full Stack Deployment
# Usage: docker-compose up --build
# Env: Copy backend/.env.example → backend/.env and fill in keys
services:
# ── PostgreSQL Database ──
db:
image: postgres:15-alpine
container_name: stackradar_db
environment:
POSTGRES_USER: ${POSTGRES_USER:-stackradar}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-stackradar_pass}
POSTGRES_DB: ${POSTGRES_DB:-stackradar}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-stackradar}"]
interval: 10s
timeout: 5s
retries: 5
# ── FastAPI Backend ──
backend:
build:
context: ./backend
container_name: stackradar_backend
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
volumes:
- ./backend/logs:/app/logs
ports:
- "8000:8000"
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-stackradar}:${POSTGRES_PASSWORD:-stackradar_pass}@db:5432/${POSTGRES_DB:-stackradar}
- RUN_SCRAPER_INLINE=1
- DOCKER_ENV=1
depends_on:
db:
condition: service_healthy
restart: unless-stopped
# ── Next.js Frontend ──
frontend:
build:
context: ./frontend
args:
# The Next server proxies /api/v1/* to the backend (see next.config.ts).
# Inside the compose network the backend is the `backend` service, not
# localhost. rewrites() is evaluated at build time, so this must be a
# build arg, and it's re-set at runtime below.
BACKEND_ORIGIN: http://backend:8000
container_name: stackradar_frontend
ports:
- "3000:3000"
environment:
- BACKEND_ORIGIN=http://backend:8000
depends_on:
- backend
restart: unless-stopped
volumes:
postgres_data: