-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (117 loc) · 4.39 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (117 loc) · 4.39 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
# Project name: just `spp` on the main clone, `spp-<slug>` on a worktree
# sibling. The ${VAR:+text} substitution pattern expands to the text only
# when VAR is set and non-empty, so the hyphen + slug suffix is opt-in per
# worktree. Same idiom applied to container_name below.
name: spp${WORKTREE_SLUG:+-${WORKTREE_SLUG}}
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
image: spp-backend:dev
container_name: spp-backend${WORKTREE_SLUG:+-${WORKTREE_SLUG}}
ports:
- '${BACKEND_PORT:-3000}:3000'
volumes:
- ./backend:/app
# Named volume preserves the container's node_modules (linux-alpine
# compiled) against the ./backend:/app bind mount that would otherwise
# shadow it with the host's node_modules (often macOS-compiled or empty).
- spp_backend_node_modules:/app/node_modules
- /tmp:/tmp
- /var/run/docker.sock:/var/run/docker.sock
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
- AWS_REGION=${AWS_REGION:-us-west-2}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
- EXEC_MODE=${EXEC_MODE:-local}
- NODE_ENV=development
- PORT=3000
- LAMBDA_FUNCTION_NAME=${LAMBDA_FUNCTION_NAME:-}
- USER_CODE_FILE_PREFIX=${USER_CODE_FILE_PREFIX:-main}
- DATABASE_URL=postgres://spp:spp@postgres:5432/${DB_NAME:-seepp_main}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID:-}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET:-}
- SESSION_SECRET=${SESSION_SECRET:-}
- OAUTH_CALLBACK_BASE_URL=${OAUTH_CALLBACK_BASE_URL:-http://localhost:${FRONTEND_PORT:-4000}}
# Local-only dev sign-in; triple-gated server-side. See auth-runbook.
- DEV_AUTH_ENABLED=${DEV_AUTH_ENABLED:-}
# Admin bootstrap — comma/semicolon-separated emails promoted on sign-in.
- ADMIN_EMAILS=${ADMIN_EMAILS:-}
# Auto-promote dev@localhost when DevAuthProvider is in use (default on
# in dev; set to "false" to test the non-admin path).
- DEV_AUTH_IS_ADMIN=${DEV_AUTH_IS_ADMIN:-true}
depends_on:
- code-runner-local-build
- postgres
postgres:
image: postgres:16-alpine
container_name: spp-postgres${WORKTREE_SLUG:+-${WORKTREE_SLUG}}
environment:
POSTGRES_USER: spp
POSTGRES_PASSWORD: spp
POSTGRES_DB: ${DB_NAME:-seepp_main}
ports:
- '${DB_PORT:-5432}:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
code-runner-local-build:
build:
context: ./code-runner
dockerfile: local/Dockerfile
image: spp-code-runner-local:dev
deploy:
replicas: 0
command: echo "code-runner-local image built"
networks:
- no-internet
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
image: spp-frontend:dev
container_name: spp-frontend${WORKTREE_SLUG:+-${WORKTREE_SLUG}}
ports:
# Host-side port is worktree-assigned; container always listens on 4000.
- '${FRONTEND_PORT:-4000}:4000'
volumes:
- ./frontend:/app
# Named volume preserves the container's node_modules (linux-alpine
# compiled) against the ./frontend:/app bind mount that would otherwise
# shadow it with the host's node_modules (often macOS-compiled or empty).
- spp_frontend_node_modules:/app/node_modules
environment:
- NODE_ENV=development
# Force chokidar polling; FS events don't propagate reliably through
# docker-for-mac bind mounts, so HMR stalls without this.
- CHOKIDAR_USEPOLLING=true
# Proxy target for /api — compose service-name DNS, not localhost.
- VITE_BACKEND_URL=http://backend:3000
depends_on:
- backend
# Legacy 2018 frontend, kept for feature-parity reference. Port hard-coded
# to 8000 as before; running it in multiple worktrees simultaneously will
# conflict, which is acceptable — legacy is reference material, not
# actively developed.
frontend-legacy:
build:
context: ./frontend-legacy
dockerfile: Dockerfile.dev
args:
SPP_API_URL: 'http://localhost:3000/api'
image: spp-frontend-legacy:dev
container_name: spp-frontend-legacy${WORKTREE_SLUG:+-${WORKTREE_SLUG}}
ports:
- '8000:8000'
volumes:
- ./frontend-legacy:/app
environment:
- NODE_ENV=development
networks:
no-internet:
driver: bridge
internal: true
volumes:
postgres_data:
spp_backend_node_modules:
spp_frontend_node_modules: