-
Notifications
You must be signed in to change notification settings - Fork 24
/
docker-compose.local.yml
145 lines (135 loc) · 3.66 KB
/
docker-compose.local.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
version: '3.9'
services:
caddy:
image: caddy
restart: unless-stopped
ports:
- "80:80"
environment:
SERVER_DOMAIN: ${SERVER_DOMAIN}
API_DOMAIN: ${API_DOMAIN}
MEDIA_HOSTING_URL: ${MEDIA_HOSTING_URL}
MEDIA_HOSTING_CLIENT_ID: ${MEDIA_HOSTING_CLIENT_ID}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY}
VAPID_CONTACT: ${VAPID_CONTACT}
FINGERPRINT: ${FINGERPRINT}
volumes:
- $PWD/caddy/Caddyfile.local:/etc/caddy/Caddyfile:ro
- frontend_build:/srv:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- backend
mysql:
platform: linux/amd64
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
- mysql_db:/var/lib/mysql
- $PWD/mysql/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 5s
timeout: 20s
retries: 10
redis:
image: redis:7
restart: always
command: redis-server --save 20 1 --requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
healthcheck:
test: redis-cli -a ${REDIS_PASSWORD} ping | grep PONG
interval: 5s
timeout: 20s
retries: 10
frontend:
build:
context: frontend
args:
NODE_ENV: production
SERVER_DOMAIN: ${SERVER_DOMAIN}
MEDIA_HOSTING_URL: ${MEDIA_HOSTING_URL}
API_DOMAIN: ${API_DOMAIN}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
restart: "no"
volumes:
- frontend_build:/frontend
backend:
build:
context: backend
restart: always
environment:
SITE_DOMAIN: ${SERVER_DOMAIN}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
SENDING_BLUE_API_KEY: ${SENDING_BLUE_API_KEY}
DEEPL_API_KEY: ${DEEPL_API_KEY}
MEDIA_HOSTING_URL: ${MEDIA_HOSTING_URL}
MEDIA_HOSTING_DIMS_AES_KEY: ${MEDIA_HOSTING_DIMS_AES_KEY}
BARMALINI_USER_ID: ${BARMALINI_USER_ID}
BARMALINI_KEY: ${BARMALINI_KEY}
OPENAI_API_KEY: ${OPENAI_API_KEY}
depends_on:
- mysql
- redis
- feed
- elasticsearch-setup
feed:
build:
context: feed
restart: always
elasticsearch:
image: elasticsearch:7.17.8
restart: always
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
nofile:
soft: 65536
hard: 65536
memlock:
soft: -1
hard: -1
healthcheck:
test: curl -s -f http://localhost:9200/_cluster/health?wait_for_status=green >/dev/null || exit 1
interval: 10s
timeout: 30s
retries: 10
volumes:
- elasticsearch_data:/usr/share/elastic-setup/data
- $PWD/search/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
# performs initial setup of elasticsearch and exits
elasticsearch-setup:
image: curlimages/curl
restart: "no"
depends_on:
elasticsearch:
condition: service_healthy
volumes:
- $PWD/search/setup.sh:/setup.sh:ro
entrypoint: /bin/sh
command: /setup.sh
# performs periodic indexing of elasticsearch
elasticsearch-indexer:
build:
context: search
restart: always
depends_on:
mysql:
condition: service_healthy
elasticsearch:
condition: service_healthy
elasticsearch-setup:
condition: service_completed_successfully
backend:
condition: service_started # TODO change to service_healthy when we have a healthcheck
volumes:
caddy_data:
caddy_config:
frontend_build:
mysql_db:
redis_data:
elasticsearch_data: