-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 2.82 KB
/
docker-compose.yml
File metadata and controls
94 lines (89 loc) · 2.82 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
# SimpleNotes - Docker Compose
# Local development environment with all services
services:
# ============================================
# Backend - FastAPI
# ============================================
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: simplenotes-backend
ports:
- "8000:8000"
environment:
- ENVIRONMENT=docker
- AWS_REGION=${AWS_REGION:-ca-central-1}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
# DynamoDB tables (uses staging by default)
- USERS_TABLE=${USERS_TABLE:-simplenotes-staging-users}
- HOUSEHOLDS_TABLE=${HOUSEHOLDS_TABLE:-simplenotes-staging-households}
- LISTS_TABLE=${LISTS_TABLE:-simplenotes-staging-lists}
- INVITES_TABLE=${INVITES_TABLE:-simplenotes-staging-invites}
# Cognito
- COGNITO_USER_POOL_ID=${COGNITO_USER_POOL_ID}
- COGNITO_CLIENT_ID=${COGNITO_CLIENT_ID}
- COGNITO_REGION=${AWS_REGION:-ca-central-1}
# Frontend URL for CORS
- FRONTEND_URL=http://localhost:3000
volumes:
# Mount source code for hot reload during development
- ./backend/app:/app/app:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- simplenotes-network
# ============================================
# Frontend - React + Nginx
# ============================================
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_URL=http://localhost:8000
container_name: simplenotes-frontend
ports:
- "3000:80"
environment:
- API_URL=http://backend:8000
- COGNITO_CLIENT_ID=${COGNITO_CLIENT_ID}
- COGNITO_USER_POOL_ID=${COGNITO_USER_POOL_ID}
- COGNITO_DOMAIN=${COGNITO_DOMAIN}
- AWS_REGION=${AWS_REGION:-ca-central-1}
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- simplenotes-network
# ============================================
# DynamoDB Local (optional - for offline dev)
# ============================================
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: simplenotes-dynamodb
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /data"
ports:
- "8001:8000"
volumes:
- dynamodb-data:/data
profiles:
- local # Only starts with: docker compose --profile local up
networks:
- simplenotes-network
networks:
simplenotes-network:
driver: bridge
volumes:
dynamodb-data: