Skip to content

Commit 3eb80c5

Browse files
authored
Support SELinux in docker-compose.yml examples (fix #324) (#1957)
Signed-off-by: J0WI <[email protected]>
1 parent 30bb621 commit 3eb80c5

8 files changed

Lines changed: 64 additions & 64 deletions

File tree

.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
77
restart: always
88
volumes:
9-
- db:/var/lib/mysql
9+
- db:/var/lib/mysql:Z
1010
environment:
1111
- MYSQL_ROOT_PASSWORD=
1212
- MARIADB_AUTO_UPGRADE=1
@@ -24,7 +24,7 @@ services:
2424
ports:
2525
- 127.0.0.1:8080:80
2626
volumes:
27-
- nextcloud:/var/www/html
27+
- nextcloud:/var/www/html:z
2828
environment:
2929
- MYSQL_HOST=db
3030
- REDIS_HOST=redis
@@ -38,7 +38,7 @@ services:
3838
image: nextcloud:apache
3939
restart: always
4040
volumes:
41-
- nextcloud:/var/www/html
41+
- nextcloud:/var/www/html:z
4242
entrypoint: /cron.sh
4343
depends_on:
4444
- db

.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
77
restart: always
88
volumes:
9-
- db:/var/lib/mysql
9+
- db:/var/lib/mysql:Z
1010
environment:
1111
- MYSQL_ROOT_PASSWORD=
1212
- MARIADB_AUTO_UPGRADE=1
@@ -22,7 +22,7 @@ services:
2222
image: nextcloud:fpm-alpine
2323
restart: always
2424
volumes:
25-
- nextcloud:/var/www/html
25+
- nextcloud:/var/www/html:z
2626
environment:
2727
- MYSQL_HOST=db
2828
- REDIS_HOST=redis
@@ -38,15 +38,15 @@ services:
3838
ports:
3939
- 127.0.0.1:8080:80
4040
volumes:
41-
- nextcloud:/var/www/html:ro
41+
- nextcloud:/var/www/html:z,ro
4242
depends_on:
4343
- app
4444

4545
cron:
4646
image: nextcloud:fpm-alpine
4747
restart: always
4848
volumes:
49-
- nextcloud:/var/www/html
49+
- nextcloud:/var/www/html:z
5050
entrypoint: /cron.sh
5151
depends_on:
5252
- db

.examples/docker-compose/insecure/postgres/apache/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
image: postgres:alpine
66
restart: always
77
volumes:
8-
- db:/var/lib/postgresql/data
8+
- db:/var/lib/postgresql/data:Z
99
env_file:
1010
- db.env
1111

@@ -19,7 +19,7 @@ services:
1919
ports:
2020
- 127.0.0.1:8080:80
2121
volumes:
22-
- nextcloud:/var/www/html
22+
- nextcloud:/var/www/html:z
2323
environment:
2424
- POSTGRES_HOST=db
2525
- REDIS_HOST=redis
@@ -33,7 +33,7 @@ services:
3333
image: nextcloud:apache
3434
restart: always
3535
volumes:
36-
- nextcloud:/var/www/html
36+
- nextcloud:/var/www/html:z
3737
entrypoint: /cron.sh
3838
depends_on:
3939
- db

.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
image: postgres:alpine
66
restart: always
77
volumes:
8-
- db:/var/lib/postgresql/data
8+
- db:/var/lib/postgresql/data:z
99
env_file:
1010
- db.env
1111

@@ -17,7 +17,7 @@ services:
1717
image: nextcloud:fpm-alpine
1818
restart: always
1919
volumes:
20-
- nextcloud:/var/www/html
20+
- nextcloud:/var/www/html:z
2121
environment:
2222
- POSTGRES_HOST=db
2323
- REDIS_HOST=redis
@@ -33,15 +33,15 @@ services:
3333
ports:
3434
- 127.0.0.1:8080:80
3535
volumes:
36-
- nextcloud:/var/www/html:ro
36+
- nextcloud:/var/www/html:z,ro
3737
depends_on:
3838
- app
3939

4040
cron:
4141
image: nextcloud:fpm-alpine
4242
restart: always
4343
volumes:
44-
- nextcloud:/var/www/html
44+
- nextcloud:/var/www/html:z
4545
entrypoint: /cron.sh
4646
depends_on:
4747
- db

.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
77
restart: always
88
volumes:
9-
- db:/var/lib/mysql
9+
- db:/var/lib/mysql:Z
1010
environment:
1111
- MYSQL_ROOT_PASSWORD=
1212
- MARIADB_AUTO_UPGRADE=1
@@ -22,7 +22,7 @@ services:
2222
image: nextcloud:apache
2323
restart: always
2424
volumes:
25-
- nextcloud:/var/www/html
25+
- nextcloud:/var/www/html:z
2626
environment:
2727
- VIRTUAL_HOST=
2828
- LETSENCRYPT_HOST=
@@ -42,7 +42,7 @@ services:
4242
image: nextcloud:apache
4343
restart: always
4444
volumes:
45-
- nextcloud:/var/www/html
45+
- nextcloud:/var/www/html:z
4646
entrypoint: /cron.sh
4747
depends_on:
4848
- db
@@ -57,22 +57,22 @@ services:
5757
labels:
5858
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
5959
volumes:
60-
- certs:/etc/nginx/certs:ro
61-
- vhost.d:/etc/nginx/vhost.d
62-
- html:/usr/share/nginx/html
63-
- /var/run/docker.sock:/tmp/docker.sock:ro
60+
- certs:/etc/nginx/certs:z,ro
61+
- vhost.d:/etc/nginx/vhost.d:z
62+
- html:/usr/share/nginx/html:z
63+
- /var/run/docker.sock:/tmp/docker.sock:z,ro
6464
networks:
6565
- proxy-tier
6666

6767
letsencrypt-companion:
6868
image: nginxproxy/acme-companion
6969
restart: always
7070
volumes:
71-
- certs:/etc/nginx/certs
72-
- acme:/etc/acme.sh
73-
- vhost.d:/etc/nginx/vhost.d
74-
- html:/usr/share/nginx/html
75-
- /var/run/docker.sock:/var/run/docker.sock:ro
71+
- certs:/etc/nginx/certs:z
72+
- acme:/etc/acme.sh:z
73+
- vhost.d:/etc/nginx/vhost.d:z
74+
- html:/usr/share/nginx/html:z
75+
- /var/run/docker.sock:/var/run/docker.sock:z,ro
7676
networks:
7777
- proxy-tier
7878
depends_on:

.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
77
restart: always
88
volumes:
9-
- db:/var/lib/mysql
9+
- db:/var/lib/mysql:Z
1010
environment:
1111
- MYSQL_ROOT_PASSWORD=
1212
- MARIADB_AUTO_UPGRADE=1
@@ -22,7 +22,7 @@ services:
2222
image: nextcloud:fpm-alpine
2323
restart: always
2424
volumes:
25-
- nextcloud:/var/www/html
25+
- nextcloud:/var/www/html:z
2626
environment:
2727
- MYSQL_HOST=db
2828
- REDIS_HOST=redis
@@ -36,7 +36,7 @@ services:
3636
build: ./web
3737
restart: always
3838
volumes:
39-
- nextcloud:/var/www/html:ro
39+
- nextcloud:/var/www/html:z,ro
4040
environment:
4141
- VIRTUAL_HOST=
4242
- LETSENCRYPT_HOST=
@@ -51,7 +51,7 @@ services:
5151
image: nextcloud:fpm-alpine
5252
restart: always
5353
volumes:
54-
- nextcloud:/var/www/html
54+
- nextcloud:/var/www/html:z
5555
entrypoint: /cron.sh
5656
depends_on:
5757
- db
@@ -66,22 +66,22 @@ services:
6666
labels:
6767
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
6868
volumes:
69-
- certs:/etc/nginx/certs:ro
70-
- vhost.d:/etc/nginx/vhost.d
71-
- html:/usr/share/nginx/html
72-
- /var/run/docker.sock:/tmp/docker.sock:ro
69+
- certs:/etc/nginx/certs:z,ro
70+
- vhost.d:/etc/nginx/vhost.d:z
71+
- html:/usr/share/nginx/html:z
72+
- /var/run/docker.sock:/tmp/docker.sock:z,ro
7373
networks:
7474
- proxy-tier
7575

7676
letsencrypt-companion:
7777
image: nginxproxy/acme-companion
7878
restart: always
7979
volumes:
80-
- certs:/etc/nginx/certs
81-
- acme:/etc/acme.sh
82-
- vhost.d:/etc/nginx/vhost.d
83-
- html:/usr/share/nginx/html
84-
- /var/run/docker.sock:/var/run/docker.sock:ro
80+
- certs:/etc/nginx/certs:z
81+
- acme:/etc/acme.sh:z
82+
- vhost.d:/etc/nginx/vhost.d:z
83+
- html:/usr/share/nginx/html:z
84+
- /var/run/docker.sock:/var/run/docker.sock:z,ro
8585
networks:
8686
- proxy-tier
8787
depends_on:

.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
image: postgres:alpine
66
restart: always
77
volumes:
8-
- db:/var/lib/postgresql/data
8+
- db:/var/lib/postgresql/data:Z
99
env_file:
1010
- db.env
1111

@@ -17,7 +17,7 @@ services:
1717
image: nextcloud:apache
1818
restart: always
1919
volumes:
20-
- nextcloud:/var/www/html
20+
- nextcloud:/var/www/html:z
2121
environment:
2222
- VIRTUAL_HOST=
2323
- LETSENCRYPT_HOST=
@@ -37,7 +37,7 @@ services:
3737
image: nextcloud:apache
3838
restart: always
3939
volumes:
40-
- nextcloud:/var/www/html
40+
- nextcloud:/var/www/html:z
4141
entrypoint: /cron.sh
4242
depends_on:
4343
- db
@@ -52,22 +52,22 @@ services:
5252
labels:
5353
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
5454
volumes:
55-
- certs:/etc/nginx/certs:ro
56-
- vhost.d:/etc/nginx/vhost.d
57-
- html:/usr/share/nginx/html
58-
- /var/run/docker.sock:/tmp/docker.sock:ro
55+
- certs:/etc/nginx/certs:z,ro
56+
- vhost.d:/etc/nginx/vhost.d:z
57+
- html:/usr/share/nginx/html:z
58+
- /var/run/docker.sock:/tmp/docker.sock:z,ro
5959
networks:
6060
- proxy-tier
6161

6262
letsencrypt-companion:
6363
image: nginxproxy/acme-companion
6464
restart: always
6565
volumes:
66-
- certs:/etc/nginx/certs
67-
- acme:/etc/acme.sh
68-
- vhost.d:/etc/nginx/vhost.d
69-
- html:/usr/share/nginx/html
70-
- /var/run/docker.sock:/var/run/docker.sock:ro
66+
- certs:/etc/nginx/certs:z
67+
- acme:/etc/acme.sh:z
68+
- vhost.d:/etc/nginx/vhost.d:z
69+
- html:/usr/share/nginx/html:z
70+
- /var/run/docker.sock:/var/run/docker.sock:z,ro
7171
networks:
7272
- proxy-tier
7373
depends_on:

.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
image: postgres:alpine
66
restart: always
77
volumes:
8-
- db:/var/lib/postgresql/data
8+
- db:/var/lib/postgresql/data:Z
99
env_file:
1010
- db.env
1111

@@ -17,7 +17,7 @@ services:
1717
image: nextcloud:fpm-alpine
1818
restart: always
1919
volumes:
20-
- nextcloud:/var/www/html
20+
- nextcloud:/var/www/html:z
2121
environment:
2222
- POSTGRES_HOST=db
2323
- REDIS_HOST=redis
@@ -31,7 +31,7 @@ services:
3131
build: ./web
3232
restart: always
3333
volumes:
34-
- nextcloud:/var/www/html:ro
34+
- nextcloud:/var/www/html:z,ro
3535
environment:
3636
- VIRTUAL_HOST=
3737
- LETSENCRYPT_HOST=
@@ -46,7 +46,7 @@ services:
4646
image: nextcloud:fpm-alpine
4747
restart: always
4848
volumes:
49-
- nextcloud:/var/www/html
49+
- nextcloud:/var/www/html:z
5050
entrypoint: /cron.sh
5151
depends_on:
5252
- db
@@ -61,22 +61,22 @@ services:
6161
labels:
6262
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
6363
volumes:
64-
- certs:/etc/nginx/certs:ro
65-
- vhost.d:/etc/nginx/vhost.d
66-
- html:/usr/share/nginx/html
67-
- /var/run/docker.sock:/tmp/docker.sock:ro
64+
- certs:/etc/nginx/certs:z,ro
65+
- vhost.d:/etc/nginx/vhost.d:z
66+
- html:/usr/share/nginx/html:z
67+
- /var/run/docker.sock:/tmp/docker.sock:z,ro
6868
networks:
6969
- proxy-tier
7070

7171
letsencrypt-companion:
7272
image: nginxproxy/acme-companion
7373
restart: always
7474
volumes:
75-
- certs:/etc/nginx/certs
76-
- acme:/etc/acme.sh
77-
- vhost.d:/etc/nginx/vhost.d
78-
- html:/usr/share/nginx/html
79-
- /var/run/docker.sock:/var/run/docker.sock:ro
75+
- certs:/etc/nginx/certs:z
76+
- acme:/etc/acme.sh:z
77+
- vhost.d:/etc/nginx/vhost.d:z
78+
- html:/usr/share/nginx/html:z
79+
- /var/run/docker.sock:/var/run/docker.sock:z,ro
8080
networks:
8181
- proxy-tier
8282
depends_on:

0 commit comments

Comments
 (0)