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
# =============================================================================
# Armature Cloud Run - Local Development Environment
# =============================================================================
# Simulates Cloud Run environment locally
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Application (Cloud Run simulation)
# ---------------------------------------------------------------------------
app:
build:
context: .
dockerfile: Dockerfile
target: runtime-debug # Use debug target for local development
container_name: armature-cloudrun-app
ports:
- "8080:8080"
environment:
# Cloud Run environment variables
- PORT=8080
- K_SERVICE=armature-app
- K_REVISION=armature-app-00001
- K_CONFIGURATION=armature-app
- GOOGLE_CLOUD_PROJECT=local-project
# Application configuration
- RUST_LOG=debug
- DATABASE_URL=postgres://armature:armature@postgres:5432/armature
- REDIS_URL=redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test:
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# ---------------------------------------------------------------------------
# PostgreSQL Database
# ---------------------------------------------------------------------------
postgres:
image: postgres:16-alpine
container_name: armature-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=armature
- POSTGRES_PASSWORD=armature
- POSTGRES_DB=armature
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test:
interval: 5s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Redis Cache
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: armature-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test:
interval: 5s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Pub/Sub Emulator (Google Cloud Pub/Sub)
# ---------------------------------------------------------------------------
pubsub:
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators
container_name: armature-pubsub
command: gcloud beta emulators pubsub start --host-port=0.0.0.0:8085
ports:
- "8085:8085"
# ---------------------------------------------------------------------------
# Firestore Emulator
# ---------------------------------------------------------------------------
firestore:
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators
container_name: armature-firestore
command: gcloud emulators firestore start --host-port=0.0.0.0:8086
ports:
- "8086:8086"
volumes:
postgres_data:
redis_data:
networks:
default:
name: armature-cloudrun-net