File tree Expand file tree Collapse file tree 3 files changed +43
-8
lines changed Expand file tree Collapse file tree 3 files changed +43
-8
lines changed Original file line number Diff line number Diff line change @@ -18,25 +18,39 @@ services:
18
18
- data-uploads:/linuxfr.org/uploads
19
19
tmpfs :
20
20
- /linuxfr.org/public/tmp:size=100M
21
+ healthcheck :
22
+ test : curl --fail http://localhost:3000
21
23
depends_on :
22
- - database
23
- - redis
24
+ database :
25
+ condition : service_completed_successfully
26
+ restart : true
27
+ redis :
28
+ condition : service_completed_successfully
29
+ restart : true
24
30
25
31
linuxfr-board :
26
32
build :
27
33
context : deployment/linuxfr-board
28
34
env_file :
29
35
- deployment/default.env
36
+ healthcheck :
37
+ test : curl --fail -I http://localhost:9000
30
38
depends_on :
31
- - redis
39
+ redis :
40
+ condition : service_completed_successfully
41
+ restart : true
32
42
33
43
linuxfr-img :
34
44
build :
35
45
context : deployment/linuxfr-img
36
46
env_file :
37
47
- deployment/default.env
48
+ healthcheck :
49
+ test : curl --fail http://localhost:8000/status
38
50
depends_on :
39
- - redis
51
+ redis :
52
+ condition : service_completed_successfully
53
+ restart : true
40
54
volumes :
41
55
- cache-img:/linuxfr-img/cache
42
56
@@ -53,9 +67,15 @@ services:
53
67
published : 127.0.0.1:80
54
68
protocol : tcp
55
69
depends_on :
56
- - linuxfr.org
57
- - linuxfr-board
58
- - linuxfr-img
70
+ linuxfr.org :
71
+ condition : service_completed_successfully
72
+ restart : true
73
+ linuxfr-board :
74
+ condition : service_completed_successfully
75
+ restart : true
76
+ linuxfr-img :
77
+ condition : service_completed_successfully
78
+ restart : true
59
79
60
80
database :
61
81
build :
@@ -66,11 +86,15 @@ services:
66
86
- target : 3306
67
87
published : 127.0.0.1:3306
68
88
protocol : tcp
89
+ healthcheck :
90
+ test : mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
69
91
volumes :
70
92
- data-database:/var/lib/mysql
71
93
72
94
redis :
73
95
image : docker.io/redis:5
96
+ healthcheck :
97
+ test : redis-cli --raw incr ping
74
98
volumes :
75
99
- data-redis:/data
76
100
Original file line number Diff line number Diff line change 16
16
IFS=$'\n\t ' ; \
17
17
apt-get update; \
18
18
# Install dependencies \
19
+ # and add curl to be used by the healthcheck defined in compose.yaml \
19
20
apt-get install -y --no-install-recommends \
20
- build-essential git ruby ruby-dev; \
21
+ build-essential git ruby ruby-dev \
22
+ curl; \
21
23
apt-get clean;
22
24
23
25
USER ${UID}
Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ FROM docker.io/debian:bullseye-slim as deploy
31
31
USER ${UID}
32
32
WORKDIR /linuxfr-img
33
33
34
+ # Install curl to be used by the healthcheck defined in compose.yaml
35
+ RUN \
36
+ set -eux; \
37
+ IFS=$'\n\t ' ; \
38
+ apt-get update; \
39
+ apt-get install -y --no-install-recommends \
40
+ curl; \
41
+ apt-get clean;
42
+
34
43
COPY --from=build --chown=${UID}:0 --chmod=770 /linuxfr-img/bin/img-LinuxFr.org .
35
44
36
45
EXPOSE 8000
You can’t perform that action at this time.
0 commit comments