-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathcompose.yaml
More file actions
152 lines (145 loc) · 3.89 KB
/
Copy pathcompose.yaml
File metadata and controls
152 lines (145 loc) · 3.89 KB
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
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: 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
dockerfile: Containerfile
env_file:
- deployment/default.env
healthcheck:
test: 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
dockerfile: Containerfile
env_file:
- deployment/default.env
healthcheck:
test: 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/nginxinc/nginx-unprivileged:stable-alpine
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: 8080
# If you customize the published port, you have to update the
# DOMAIN_HTTP_PORT and IMAGE_DOMAIN_HTTP_PORT variables
# into the `deployment/default.env` file too
published: 9000
host_ip: 127.0.0.1
protocol: tcp
healthcheck:
test: >-
curl --silent --fail --fail-early --location --head
http://$$DOMAIN:8080 http://$$DOMAIN:8080/img/status
http://$$DOMAIN:8080/b http://$$IMAGE_DOMAIN:8080/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}
# fallback for Docker as it cannot add aliases from environment variables
- dlfp.lo
- image.dlfp.lo
database:
build:
context: deployment/database
dockerfile: Containerfile
env_file:
- deployment/default.env
ports:
- target: 3306
published: 3306
host_ip: 127.0.0.1
protocol: tcp
healthcheck:
test: >-
exec 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: 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