-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathdocker-compose-example.yml
222 lines (207 loc) · 5.23 KB
/
docker-compose-example.yml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
version: '3.4'
x-common-variables: &feedbin-environment
- PORT
- RACK_ENV
- RAILS_ENV
- SECRET_KEY_BASE
- DEFAULT_URL_OPTIONS_HOST
- PUSH_URL
- FEEDBIN_URL
- FEEDBIN_HOST=$FEEDBIN_HOST,api.feedbin.com
- FORCE_SSL
- ELASTICSEARCH_URL
- MEMCACHED_HOSTS
- REDIS_URL
- DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@feedbin-postgres/feedbin_production
- EXTRACT_HOST
- EXTRACT_USER
- EXTRACT_SECRET
- CAMO_HOST=https://$CAMO_HOST
- CAMO_KEY
- SMTP_ADDRESS
- SMTP_USERNAME
- SMTP_PASSWORD
- SMTP_DOMAIN
- FROM_ADDRESS
- AWS_ACCESS_KEY_ID=$MINIO_ACCESS_KEY
- AWS_SECRET_ACCESS_KEY=$MINIO_SECRET_KEY
- AWS_S3_BUCKET=$MINIO_BUCKET
- AWS_S3_BUCKET_FAVICONS=$MINIO_BUCKET
- AWS_S3_ENDPOINT=https://$MINIO_HOST
- AWS_S3_PATH_STYLE
- ENTRY_IMAGE_HOST=$MINIO_HOST
- TWITTER_KEY
- TWITTER_SECRET
services:
feedbin-caddy:
image: caddy:alpine
container_name: feedbin-caddy
ports:
- 80:80
- 443:443
environment:
- FEEDBIN_HOST
- FEEDBIN_API_HOST
- MINIO_HOST
- EXTRACT_HOST
- CAMO_HOST
volumes:
- $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- feedbin_caddy_data:/data
- feedbin_caddy_config:/config
restart: unless-stopped
depends_on:
- feedbin-minio
healthcheck:
test: ["CMD", "curl", "-f", "http://$FEEDBIN_HOST/health"]
interval: 30s
timeout: 20s
retries: 3
feedbin-minio:
image: minio/minio:latest
container_name: feedbin-minio
environment:
- MINIO_ACCESS_KEY
- MINIO_SECRET_KEY
volumes:
- feedbin_minio:/data
command: server /data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
feedbin-minio-create:
image: minio/mc:latest
container_name: feedbin-minio-create
depends_on:
- feedbin-minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add minio http://feedbin-minio:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY;
/usr/bin/mc mb minio/$MINIO_BUCKET;
/usr/bin/mc policy set download minio/$MINIO_BUCKET;
exit 0;
"
feedbin-web:
build:
context: ./feedbin-web
args:
FEEDBIN_URL: $FEEDBIN_URL
container_name: feedbin-web
environment: *feedbin-environment
depends_on:
- feedbin-minio
- feedbin-elasticsearch
- feedbin-memcached
- feedbin-redis
- feedbin-postgres
command: bundle exec rails s --port $PORT --binding 0.0.0.0
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:$PORT"]
interval: 30s
timeout: 20s
retries: 3
feedbin-workers:
build: ./feedbin-web
container_name: feedbin-workers
environment: *feedbin-environment
command: foreman start
restart: unless-stopped
feedbin-elasticsearch:
image: elasticsearch:2.4
container_name: feedbin-elasticsearch
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
volumes:
- feedbin_elasticsearch:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200"]
interval: 30s
timeout: 20s
retries: 3
feedbin-refresher:
build: ./feedbin-refresher
environment:
- REDIS_URL
- TWITTER_KEY
- TWITTER_SECRET
container_name: feedbin-refresher
restart: unless-stopped
feedbin-image:
build: ./feedbin-image
environment:
- AWS_ACCESS_KEY_ID=$MINIO_ACCESS_KEY
- AWS_SECRET_ACCESS_KEY=$MINIO_SECRET_KEY
- AWS_S3_BUCKET=$MINIO_BUCKET
- AWS_S3_ENDPOINT=https://$MINIO_HOST
- AWS_S3_PATH_STYLE
- REDIS_URL
container_name: feedbin-image
restart: unless-stopped
feedbin-extract:
build:
context: ./feedbin-extract
args:
EXTRACT_USER: $EXTRACT_USER
EXTRACT_SECRET: $EXTRACT_SECRET
container_name: feedbin-extract
restart: unless-stopped
camo:
image: increments/camo
container_name: feedbin-camo
environment:
- PORT=8081
- CAMO_KEY
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081"]
interval: 30s
timeout: 20s
retries: 3
feedbin-memcached:
image: memcached:1.6-alpine
container_name: feedbin-memcached
restart: unless-stopped
feedbin-redis:
image: redis:6-alpine
container_name: feedbin-redis
volumes:
- feedbin_redis:/data
command: "redis-server --appendonly yes"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 20s
retries: 3
feedbin-postgres:
image: postgres:13-alpine
container_name: feedbin-postgres
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
volumes:
- feedbin_db:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
interval: 30s
timeout: 20s
retries: 3
volumes:
feedbin_caddy_data:
feedbin_caddy_config:
feedbin_minio:
feedbin_elasticsearch:
feedbin_redis:
feedbin_db: