forked from linuxfrorg/linuxfr.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
136 lines (129 loc) · 3.49 KB
/
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
services:
linuxfr.org:
build:
context: .
dockerfile: deployment/linuxfr.org/Containerfile
env_file:
- deployment/default.env
volumes:
# Share host directories so, the developer can edit them
# and see the result without need to restart the container
- ./app:/linuxfr.org/app:Z
- ./db:/linuxfr.org/db:Z
- ./Gemfile:/linuxfr.org/Gemfile:Z
- ./Gemfile.lock:/linuxfr.org/Gemfile.lock:Z
- ./lib:/linuxfr.org/lib:Z
- ./public:/linuxfr.org/public:Z
- ./test:/linuxfr.org/test:Z
# uploads are shared with the nginx service
- data-uploads:/linuxfr.org/uploads
tmpfs:
- /linuxfr.org/public/tmp:size=100M
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "--head", "http://localhost:3000"]
interval: 10s
start_period: 5s
depends_on:
database:
condition: service_healthy
restart: true
redis:
condition: service_healthy
restart: true
linuxfr-board:
build:
context: deployment/linuxfr-board
env_file:
- deployment/default.env
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "--head", "http://localhost:9000"]
interval: 10s
start_period: 5s
depends_on:
redis:
condition: service_healthy
restart: true
linuxfr-img:
build:
context: deployment/linuxfr-img
env_file:
- deployment/default.env
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "--head", "http://localhost:8000/status"]
interval: 10s
start_period: 5s
depends_on:
redis:
condition: service_healthy
restart: true
volumes:
- cache-img:/linuxfr-img/cache
nginx:
image: docker.io/nginx:stable
env_file:
- deployment/default.env
volumes:
- ./deployment/nginx/templates:/etc/nginx/templates:Z
- ./public/fonts:/var/linuxfr/fonts:Z
- data-uploads:/var/linuxfr/uploads
ports:
- target: 80
published: 127.0.0.1:80
protocol: tcp
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "--fail-early", "--head", "http://$$DOMAIN", "http://$$DOMAIN/img", "http://$$DOMAIN/b", "http://$$IMAGE_DOMAIN/status"]
interval: 10s
start_period: 5s
depends_on:
database:
condition: service_healthy
restart: true
redis:
condition: service_healthy
restart: true
linuxfr.org:
condition: service_healthy
restart: true
linuxfr-board:
condition: service_healthy
restart: true
linuxfr-img:
condition: service_healthy
restart: true
networks:
default:
aliases:
- ${DOMAIN}
- ${IMAGE_DOMAIN}
database:
build:
context: deployment/database
env_file:
- deployment/default.env
ports:
- target: 3306
published: 127.0.0.1:3306
protocol: tcp
healthcheck:
test: ["CMD", "mysql", "-h", "127.0.0.1", "-u", "$$MYSQL_USER", "--password=$$MYSQL_PASSWORD", "--execute", "\"SHOW DATABASES;\""]
interval: 10s
start_period: 5s
volumes:
- data-database:/var/lib/mysql
redis:
image: docker.io/redis:5
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
start_period: 5s
volumes:
- data-redis:/data
volumes:
data-database:
driver: local
data-redis:
driver: local
data-uploads:
driver: local
cache-img:
driver: local