-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (83 loc) · 2.57 KB
/
docker-compose.yml
File metadata and controls
87 lines (83 loc) · 2.57 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
# ============================================
# Protocol Guide - Docker Compose Dev Environment
# Usage: docker compose up
# Access: http://localhost:8081 (web) | http://localhost:3001 (API)
# ============================================
#
# This connects to your REMOTE Supabase database (set in .env).
# No local Postgres needed — just provide your Supabase credentials.
services:
# ── Full Dev Environment (server + web) ──────────────
# Runs Express API (port 3001) and Expo Metro bundler (port 8081)
# Source code is volume-mounted for hot reload
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: protocol-guide-dev
ports:
- "3001:3001" # Express API
- "8081:8081" # Expo Metro web
env_file:
- .env
environment:
- NODE_ENV=development
- PORT=3001
- EXPO_USE_METRO_WORKSPACE_ROOT=1
- EXPO_ROUTER_APP_ROOT=./app
volumes:
# Source directories (hot reload)
- ./app:/app/app
- ./components:/app/components
- ./lib:/app/lib
- ./hooks:/app/hooks
- ./contexts:/app/contexts
- ./constants:/app/constants
- ./shared:/app/shared
- ./server:/app/server
- ./drizzle:/app/drizzle
- ./scripts:/app/scripts
- ./utils:/app/utils
- ./types:/app/types
- ./assets:/app/assets
- ./public:/app/public
- ./data:/app/data
- ./web:/app/web
# Config files
- ./.env:/app/.env:ro
- ./tsconfig.json:/app/tsconfig.json:ro
- ./tsconfig.server.json:/app/tsconfig.server.json:ro
- ./tailwind.config.js:/app/tailwind.config.js:ro
- ./global.css:/app/global.css:ro
- ./babel.config.js:/app/babel.config.js:ro
- ./metro.config.js:/app/metro.config.js:ro
- ./app.config.ts:/app/app.config.ts:ro
# Prevent host node_modules from overriding container's
- /app/node_modules
restart: unless-stopped
stdin_open: true
tty: true
# ── Redis (optional — for rate limiting/caching) ─────
# Comment out if you don't need local Redis.
# The app falls back to in-memory rate limiting without it.
redis:
image: redis:7-alpine
container_name: protocol-guide-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
volumes:
- redis_data:/data
profiles:
- with-redis
volumes:
redis_data:
name: protocol-guide-redis-data
networks:
default:
name: protocol-guide-network