-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (111 loc) · 3.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
118 lines (111 loc) · 3.05 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
services:
postgres:
image: postgres:16-alpine
container_name: authservice-postgres
environment:
POSTGRES_USER: authservice
POSTGRES_PASSWORD: authservice
POSTGRES_DB: authservice
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U authservice" ]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: authservice-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
migrate:
build:
context: ./migrations
dockerfile: Dockerfile
container_name: authservice-migrate
volumes:
- ./migrations:/migrations
command:
- -path=/migrations
- -database=postgres://authservice:authservice@postgres:5432/authservice?sslmode=disable
- up
depends_on:
postgres:
condition: service_healthy
developer-service:
build:
context: .
dockerfile: services/developer-service/Dockerfile
container_name: developer-service
environment:
- DATABASE_URL=postgres://authservice:authservice@postgres:5432/authservice?sslmode=disable
- GRPC_PORT=50051
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- JWT_SECRET=${JWT_SECRET}
depends_on:
migrate:
condition: service_completed_successfully
token-service:
build:
context: .
dockerfile: services/token-service/Dockerfile
container_name: token-service
environment:
- DATABASE_URL=postgres://authservice:authservice@postgres:5432/authservice?sslmode=disable
- GRPC_PORT=50052
- REDIS_URL=redis:6379
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
user-service:
build:
context: .
dockerfile: services/user-service/Dockerfile
container_name: user-service
environment:
- DATABASE_URL=postgres://authservice:authservice@postgres:5432/authservice?sslmode=disable
- GRPC_PORT=50053
- REDIS_URL=redis:6379
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- RESEND_API_KEY=${RESEND_API_KEY}
- PLATFORM_URL=${PLATFORM_URL}
- API_PUBLIC_URL=http://localhost:8080
- EMAIL_FROM=${EMAIL_FROM}
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
api-gateway:
build:
context: .
dockerfile: services/api-gateway/Dockerfile
container_name: api-gateway
environment:
- HTTP_PORT=8080
- REDIS_URL=redis:6379
- DEVELOPER_SERVICE_ADDR=developer-service:50051
- TOKEN_SERVICE_ADDR=token-service:50052
- USER_SERVICE_ADDR=user-service:50053
- JWT_SECRET=${JWT_SECRET}
ports:
- "8080:8080"
depends_on:
- developer-service
- token-service
- user-service
volumes:
postgres_data:
redis_data: