From 860be99a4ea38c06af0a4ef86c76380433482a13 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sun, 8 Sep 2024 15:19:48 +0200 Subject: [PATCH] Fix UID and GID Signed-off-by: Bensuperpc --- Makefile | 24 +++++++++---------- infrastructure/dufs/docker-compose.dufs.yml | 2 +- .../jellyfin/docker-compose.jellyfin.yml | 2 +- .../docker-compose.projectsend.yml | 3 +++ .../projectsend/env/projectsend.env | 2 -- .../docker-compose.psitransfer.yml | 2 +- .../docker-compose.qbittorrent.yml | 3 +++ .../qbittorrent/env/qbittorrent.env | 2 -- .../syncthing/docker-compose.syncthing.yml | 3 +++ infrastructure/syncthing/env/syncthing.env | 2 -- .../docker-compose.transmission.yml | 3 +++ .../transmission/env/transmission.env | 2 -- 12 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 1bed609..df5f744 100644 --- a/Makefile +++ b/Makefile @@ -29,49 +29,49 @@ COMPOSE_DIR := --project-directory ./infrastructure UID := 1000 GID := 1000 -BUILD_ARG_VAR := --build-arg UID=$(UID) --build-arg GID=$(GID) +ENV_ARG_VAR := PUID=$(UID) PGID=$(GID) .PHONY: build all all: start .PHONY: build build: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) build + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) build .PHONY: start start: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) up -d + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) up -d .PHONY: start-at start-at: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) up + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) up .PHONY: docker-check docker-check: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) config + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) config .PHONY: stop stop: down .PHONY: down down: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) down + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) down .PHONY: restart restart: stop start .PHONY: logs logs: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) logs + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) logs .PHONY: state state: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) ps - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) top + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) ps + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) top .PHONY: update-docker update-docker: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) pull + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) pull .PHONY: update update: update-docker @@ -80,8 +80,8 @@ update: update-docker .PHONY: clean clean: - $(DOCKER) images --filter=reference='bensuperpc/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f + $(ENV_ARG_VAR) $(DOCKER) images --filter=reference='bensuperpc/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f .PHONY: purge purge: - $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) down -v --rmi all \ No newline at end of file + $(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) down -v --rmi all \ No newline at end of file diff --git a/infrastructure/dufs/docker-compose.dufs.yml b/infrastructure/dufs/docker-compose.dufs.yml index 9bc9809..3f3b13a 100644 --- a/infrastructure/dufs/docker-compose.dufs.yml +++ b/infrastructure/dufs/docker-compose.dufs.yml @@ -5,7 +5,7 @@ services: container_name: dufs profiles: - dufs - user: 1000:1000 + user: ${PUID:-1000}:${PGID:-1000} restart: on-failure:5 depends_on: - caddy diff --git a/infrastructure/jellyfin/docker-compose.jellyfin.yml b/infrastructure/jellyfin/docker-compose.jellyfin.yml index 4d116de..276ddce 100644 --- a/infrastructure/jellyfin/docker-compose.jellyfin.yml +++ b/infrastructure/jellyfin/docker-compose.jellyfin.yml @@ -6,7 +6,7 @@ services: profiles: - jellyfin restart: on-failure:5 - user: 1000:1000 + user: ${PUID:-1000}:${PGID:-1000} depends_on: - caddy env_file: diff --git a/infrastructure/projectsend/docker-compose.projectsend.yml b/infrastructure/projectsend/docker-compose.projectsend.yml index 3060864..85a52bd 100644 --- a/infrastructure/projectsend/docker-compose.projectsend.yml +++ b/infrastructure/projectsend/docker-compose.projectsend.yml @@ -32,6 +32,9 @@ services: - projectsend_db:/var/lib/mysql:rw env_file: - ./projectsend/env/projectsend_db.env + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} command: '--default-authentication-plugin=mysql_native_password' networks: - infra-network diff --git a/infrastructure/projectsend/env/projectsend.env b/infrastructure/projectsend/env/projectsend.env index 2697fac..b1774e7 100644 --- a/infrastructure/projectsend/env/projectsend.env +++ b/infrastructure/projectsend/env/projectsend.env @@ -1,3 +1 @@ -PUID=1000 -PGID=1000 MAX_UPLOAD=50000 diff --git a/infrastructure/psitransfer/docker-compose.psitransfer.yml b/infrastructure/psitransfer/docker-compose.psitransfer.yml index 3e88ceb..21b27d7 100644 --- a/infrastructure/psitransfer/docker-compose.psitransfer.yml +++ b/infrastructure/psitransfer/docker-compose.psitransfer.yml @@ -6,7 +6,7 @@ services: profiles: - psitransfer restart: on-failure:5 - user: 1000:1000 + user: ${PUID:-1000}:${PGID:-1000} depends_on: - caddy env_file: diff --git a/infrastructure/qbittorrent/docker-compose.qbittorrent.yml b/infrastructure/qbittorrent/docker-compose.qbittorrent.yml index bb71fb3..0a1aefd 100644 --- a/infrastructure/qbittorrent/docker-compose.qbittorrent.yml +++ b/infrastructure/qbittorrent/docker-compose.qbittorrent.yml @@ -10,6 +10,9 @@ services: - caddy env_file: - ./qbittorrent/env/qbittorrent.env + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} volumes: - qbittorrent_config:/config - public_data:/downloads diff --git a/infrastructure/qbittorrent/env/qbittorrent.env b/infrastructure/qbittorrent/env/qbittorrent.env index 5d85984..d6a1e27 100644 --- a/infrastructure/qbittorrent/env/qbittorrent.env +++ b/infrastructure/qbittorrent/env/qbittorrent.env @@ -1,5 +1,3 @@ -PUID=1000 -PGID=1000 TZ=Etc/UTC WEBUI_PORT=8080 TORRENTING_PORT=6881 \ No newline at end of file diff --git a/infrastructure/syncthing/docker-compose.syncthing.yml b/infrastructure/syncthing/docker-compose.syncthing.yml index 87b2f08..ac0e338 100644 --- a/infrastructure/syncthing/docker-compose.syncthing.yml +++ b/infrastructure/syncthing/docker-compose.syncthing.yml @@ -10,6 +10,9 @@ services: restart: on-failure:5 env_file: - ./syncthing/env/syncthing.env + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} volumes: - syncthing_config:/config - public_data:/data1 diff --git a/infrastructure/syncthing/env/syncthing.env b/infrastructure/syncthing/env/syncthing.env index 54094c2..e69de29 100644 --- a/infrastructure/syncthing/env/syncthing.env +++ b/infrastructure/syncthing/env/syncthing.env @@ -1,2 +0,0 @@ -PUID=1000 -PGID=1000 diff --git a/infrastructure/transmission/docker-compose.transmission.yml b/infrastructure/transmission/docker-compose.transmission.yml index 362725c..becf9a1 100644 --- a/infrastructure/transmission/docker-compose.transmission.yml +++ b/infrastructure/transmission/docker-compose.transmission.yml @@ -10,6 +10,9 @@ services: - caddy env_file: - ./transmission/env/transmission.env + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} volumes: - transmission_config:/config - public_data:/downloads diff --git a/infrastructure/transmission/env/transmission.env b/infrastructure/transmission/env/transmission.env index 15d6d16..547866d 100644 --- a/infrastructure/transmission/env/transmission.env +++ b/infrastructure/transmission/env/transmission.env @@ -1,5 +1,3 @@ -PUID=1000 -PGID=1000 TZ=Etc/UTC USER=admin PASS=4vqXCNGG09JUBe7rXkuQS8MG7ovE6Vxj \ No newline at end of file