-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
141 lines (132 loc) · 2.96 KB
/
docker-compose.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
version: "3.8"
services:
api:
image: tinaxd2/lightpub:latest
build:
context: ./rs
dockerfile: Dockerfile
args:
- BUILD_TYPE=release
healthcheck:
test: curl -s -S -o /dev/null http://localhost:8000
interval: 30s
retries: 5
start_interval: 2s
start_period: 30s
restart: unless-stopped
networks:
- internal_network
expose:
- 8000
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy
volumes:
- ./rs/lightpub.docker.prod.yml:/lightpub/lightpub.yml.sample
- ./rs/refinery.docker.prod.toml:/lightpub/refinery.toml
init: true # necessary for shutting down gracefully
lightpub_worker:
image: tinaxd2/lightpub-worker:latest
build:
context: ./rs
dockerfile: Dockerfile.worker
args:
BUILD_TYPE: release
healthcheck:
interval: 30s
retries: 5
start_interval: 2s
start_period: 30s
restart: unless-stopped
networks:
- internal_network
depends_on:
queue:
condition: service_healthy
volumes:
- ./rs/lightpub.docker.prod.yml:/lightpub/lightpub.yml.sample
environment:
WORKERS_POST: 1
WORKERS_FETCH: 3
init: true # necessary for shutting down gracefully
db:
image: mariadb:latest
networks:
- internal_network
- external_network
ports:
- 127.0.0.1:3306:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: lightpub
MYSQL_USER: lightpub
MYSQL_PASSWORD: lightpub
healthcheck:
test:
[
"CMD",
"healthcheck.sh",
"--su-mysql",
"--connect",
"--innodb_initialized",
]
start_period: 1m
start_interval: 10s
interval: 1m
timeout: 5s
retries: 3
volumes:
- db_data:/var/lib/mysql
queue:
image: cloudamqp/lavinmq
networks:
- internal_network
- external_network
healthcheck:
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
start_interval: 2s
ports:
- 127.0.0.1:5672:5672 # amqp
- 127.0.0.1:15672:15672 # management
cache:
build:
context: ./rs/memcached
dockerfile: Dockerfile
networks:
- internal_network
- external_network
ports:
- 127.0.0.1:11211:11211
frontend:
image: tinaxd2/lightpub-frontend:latest
build:
context: ./frontend
dockerfile: Dockerfile
args:
API_URL: http://localhost:8000 # CHANGE THIS
networks:
- internal_network
expose:
- 80
proxy:
image: httpd:alpine
networks:
- internal_network
- external_network
ports:
- 127.0.0.1:8000:80
volumes:
- ./docker/httpd.conf:/usr/local/apache2/conf/httpd.conf
networks:
internal_network:
internal: true
external_network:
volumes:
db_data: