Make volumes used in docker compose work when running on machines with SELinux enabled (#2853)

* Make volumes used in docker compose work when running on machines with SELinux enabled

* Switch lemmy-ui comments

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
SleeplessOne1917 2023-05-12 00:15:12 +00:00 committed by GitHub
parent af5175a282
commit 0379c9e4c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 41 deletions

View file

@ -15,11 +15,11 @@ services:
- lemmyinternal
- lemmyexternalproxy
ports:
# actual and only port facing any connection from outside
# actual and only port facing any connection from outside
- "1236:1236"
- "8536:8536"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
restart: always
depends_on:
- pictrs
@ -43,7 +43,7 @@ services:
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
- RUST_BACKTRACE=full
volumes:
- ./lemmy.hjson:/config/config.hjson
- ./lemmy.hjson:/config/config.hjson:Z
depends_on:
- postgres
- pictrs
@ -54,8 +54,8 @@ services:
# run docker compose up --build
# assuming lemmy-ui is cloned besides lemmy directory
# build:
# context: ../../lemmy-ui
# dockerfile: dev.dockerfile
# context: ../../lemmy-ui
# dockerfile: dev.dockerfile
networks:
- lemmyinternal
environment:
@ -89,7 +89,7 @@ services:
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
user: 991:991
volumes:
- ./volumes/pictrs:/mnt
- ./volumes/pictrs:/mnt:Z
restart: always
postgres:
@ -100,26 +100,31 @@ services:
# You can use this technique to add them here
# https://stackoverflow.com/a/30850095/1655478
hostname: postgres
command: [
"postgres",
"-c", "session_preload_libraries=auto_explain",
"-c", "auto_explain.log_min_duration=5ms",
"-c", "auto_explain.log_analyze=true",
"-c", "track_activity_query_size=1048576"
]
command:
[
"postgres",
"-c",
"session_preload_libraries=auto_explain",
"-c",
"auto_explain.log_min_duration=5ms",
"-c",
"auto_explain.log_analyze=true",
"-c",
"track_activity_query_size=1048576",
]
networks:
- lemmyinternal
# adding the external facing network to allow direct db access for devs
# adding the external facing network to allow direct db access for devs
- lemmyexternalproxy
ports:
# use a different port so it doesnt conflict with potential postgres db running on the host
# use a different port so it doesnt conflict with potential postgres db running on the host
- "5433:5432"
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
- ./volumes/postgres:/var/lib/postgresql/data:Z
restart: always
otel:
@ -131,9 +136,7 @@ services:
ports:
- "4317:4317"
volumes:
- type: bind
source: ./otel.yml
target: /otel-local-config.yaml
- ./otel.yaml:/otel-local-config.yaml:Z
restart: unless-stopped
depends_on:
- jaeger

View file

@ -1,4 +1,4 @@
version: '3.3'
version: "3.3"
services:
nginx:
@ -10,7 +10,7 @@ services:
- "8570:8570"
- "8580:8580"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./nginx.conf:/etc/nginx/nginx.conf:Z
restart: always
depends_on:
- pictrs
@ -25,7 +25,7 @@ services:
image: asonix/pictrs:0.4.0-beta.19
user: 991:991
volumes:
- ./volumes/pictrs_alpha:/mnt
- ./volumes/pictrs_alpha:/mnt:Z
lemmy-alpha-ui:
image: dessalines/lemmy-ui:0.17.1
@ -38,7 +38,7 @@ services:
lemmy-alpha:
image: lemmy-federation:latest
volumes:
- ./lemmy_alpha.hjson:/config/config.hjson
- ./lemmy_alpha.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
@ -55,7 +55,7 @@ services:
- POSTGRES_DB=lemmy
restart: always
volumes:
- ./volumes/postgres_alpha:/var/lib/postgresql/data
- ./volumes/postgres_alpha:/var/lib/postgresql/data:Z
lemmy-beta-ui:
image: dessalines/lemmy-ui:0.17.1
@ -68,7 +68,7 @@ services:
lemmy-beta:
image: lemmy-federation:latest
volumes:
- ./lemmy_beta.hjson:/config/config.hjson
- ./lemmy_beta.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
@ -85,7 +85,7 @@ services:
- POSTGRES_DB=lemmy
restart: always
volumes:
- ./volumes/postgres_beta:/var/lib/postgresql/data
- ./volumes/postgres_beta:/var/lib/postgresql/data:Z
lemmy-gamma-ui:
image: dessalines/lemmy-ui:0.17.1
@ -98,7 +98,7 @@ services:
lemmy-gamma:
image: lemmy-federation:latest
volumes:
- ./lemmy_gamma.hjson:/config/config.hjson
- ./lemmy_gamma.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
@ -115,7 +115,7 @@ services:
- POSTGRES_DB=lemmy
restart: always
volumes:
- ./volumes/postgres_gamma:/var/lib/postgresql/data
- ./volumes/postgres_gamma:/var/lib/postgresql/data:Z
# An instance with only an allowlist for beta
lemmy-delta-ui:
@ -129,7 +129,7 @@ services:
lemmy-delta:
image: lemmy-federation:latest
volumes:
- ./lemmy_delta.hjson:/config/config.hjson
- ./lemmy_delta.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
@ -146,7 +146,7 @@ services:
- POSTGRES_DB=lemmy
restart: always
volumes:
- ./volumes/postgres_delta:/var/lib/postgresql/data
- ./volumes/postgres_delta:/var/lib/postgresql/data:Z
# An instance who has a blocklist, with lemmy-alpha blocked
lemmy-epsilon-ui:
@ -160,7 +160,7 @@ services:
lemmy-epsilon:
image: lemmy-federation:latest
volumes:
- ./lemmy_epsilon.hjson:/config/config.hjson
- ./lemmy_epsilon.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
@ -177,4 +177,4 @@ services:
- POSTGRES_DB=lemmy
restart: always
volumes:
- ./volumes/postgres_epsilon:/var/lib/postgresql/data
- ./volumes/postgres_epsilon:/var/lib/postgresql/data:Z