-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
144 lines (135 loc) · 3.05 KB
/
docker-compose.yaml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: '3.4'
services:
caddy:
image: caddy:2.6.2-alpine
restart: unless-stopped
command: caddy reverse-proxy --from climatenews.app:443 --to web:3000
ports:
- 80:80
- 443:443
volumes:
- caddy_data:/data
depends_on:
- web
networks:
- client-side
env_file:
- .env.dev
web:
image: climatenews/web:latest
build:
context: web
target: development
environment:
- GRAPHQL_API_URL=${GRAPHQL_API_URL}
networks:
- client-side
ports:
- 3000:3000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
restart: always
deploy:
mode: replicated
replicas: 1
env_file:
- .env.dev
news_api:
image: climatenews/news_api:latest
build:
context: news_service
args:
SERVICE_NAME: api
environment:
- API_HOST=0.0.0.0
- API_PORT=8000
- RUST_LOG=info,actix=info
- DATABASE_URL=${DATABASE_URL}
ports:
- 8000:8000
networks:
- client-side
- server-side
depends_on:
- db
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
deploy:
mode: replicated
replicas: 1
env_file:
- .env.dev
news_cron:
image: climatenews/news_cron:latest
build:
context: news_service
args:
SERVICE_NAME: cron
environment:
- CRON_HOST=0.0.0.0
- CRON_PORT=8001
- RUST_LOG=info,actix=info
- DATABASE_URL=${DATABASE_URL}
- TWITTER_BEARER_TOKEN=${TWITTER_BEARER_TOKEN}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- TWITTER_CLIENT_ID=${TWITTER_CLIENT_ID}
- TWITTER_CLIENT_SECRET=${TWITTER_CLIENT_SECRET}
- TWITTER_OAUTH_TOKEN_FILE=${TWITTER_OAUTH_TOKEN_FILE}
networks:
- server-side
volumes:
- ./oauth:/oauth
depends_on:
- db
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
deploy:
mode: replicated
replicas: 1
env_file:
- .env.dev
db:
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- server-side
ports:
- 5432:5432
volumes:
- db_data:/var/lib/postgresql/data
- /backups:/backups
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
mode: replicated
replicas: 1
env_file:
- .env.dev
networks:
client-side: {}
server-side: {}
volumes:
db_data: {}
caddy_data: {}