Skip to content

Commit

Permalink
Fix UID and GID
Browse files Browse the repository at this point in the history
Signed-off-by: Bensuperpc <[email protected]>
  • Loading branch information
bensuperpc committed Sep 8, 2024
1 parent 1b9c6ad commit 860be99
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 23 deletions.
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
$(ENV_ARG_VAR) $(DOCKER) compose $(COMPOSE_DIR) $(COMPOSE_FILES) $(PROFILE_CMD) down -v --rmi all
2 changes: 1 addition & 1 deletion infrastructure/dufs/docker-compose.dufs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/jellyfin/docker-compose.jellyfin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
profiles:
- jellyfin
restart: on-failure:5
user: 1000:1000
user: ${PUID:-1000}:${PGID:-1000}
depends_on:
- caddy
env_file:
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/projectsend/docker-compose.projectsend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions infrastructure/projectsend/env/projectsend.env
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
PUID=1000
PGID=1000
MAX_UPLOAD=50000
2 changes: 1 addition & 1 deletion infrastructure/psitransfer/docker-compose.psitransfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
profiles:
- psitransfer
restart: on-failure:5
user: 1000:1000
user: ${PUID:-1000}:${PGID:-1000}
depends_on:
- caddy
env_file:
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/qbittorrent/docker-compose.qbittorrent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions infrastructure/qbittorrent/env/qbittorrent.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
PUID=1000
PGID=1000
TZ=Etc/UTC
WEBUI_PORT=8080
TORRENTING_PORT=6881
3 changes: 3 additions & 0 deletions infrastructure/syncthing/docker-compose.syncthing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions infrastructure/syncthing/env/syncthing.env
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
PUID=1000
PGID=1000
3 changes: 3 additions & 0 deletions infrastructure/transmission/docker-compose.transmission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions infrastructure/transmission/env/transmission.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
PUID=1000
PGID=1000
TZ=Etc/UTC
USER=admin
PASS=4vqXCNGG09JUBe7rXkuQS8MG7ovE6Vxj

0 comments on commit 860be99

Please sign in to comment.