Updated nextcloud to work dynamically with www-data ID and GID

This commit is contained in:
2023-07-24 22:02:51 +02:00
parent 680fedaae0
commit 74587b66a8
5 changed files with 41 additions and 11 deletions
+22 -7
View File
@@ -6,19 +6,22 @@ volumes:
driver_opts: driver_opts:
type: none type: none
o: bind o: bind
device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/home device: /nctest/home
# device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/home
ncdb: ncdb:
driver: local driver: local
driver_opts: driver_opts:
type: none type: none
o: bind o: bind
device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/database device: /nctest/db
# device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/database
ncdata: ncdata:
driver: local driver: local
driver_opts: driver_opts:
type: none type: none
o: bind o: bind
device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/storage device: /nctest/storage
# device: /srv/dev-disk-by-uuid-f3ca381b-e85a-4348-8086-833317c5d96e/dockerstorage/nextcloud/storage
services: services:
@@ -35,7 +38,11 @@ services:
- MYSQL_USER=nextcloud - MYSQL_USER=nextcloud
nextcloud: nextcloud:
build: ./nc-fpm build:
context: ./nc-fpm
args:
UID: ${MUID}
GID: ${MGID}
restart: always restart: always
links: links:
- db - db
@@ -50,17 +57,25 @@ services:
- REDIS_HOST=redis - REDIS_HOST=redis
nginx: nginx:
build: ./nginx build:
context: ./nginx
args:
UID: ${MUID}
GID: ${MGID}
restart: always restart: always
ports: ports:
- 8888:80 - 8899:80
links: links:
- nextcloud - nextcloud
volumes: volumes:
- nchome:/var/www/html:z,ro - nchome:/var/www/html:z,ro
redis: redis:
image: redis:latest build:
context: ./redis
args:
UID: ${MUID}
GID: ${MGID}
restart: always restart: always
cron: cron:
+4 -1
View File
@@ -1,7 +1,10 @@
FROM nextcloud:fpm FROM nextcloud:fpm
ARG UID=1000
ARG GID=1000
#RUN adduser --system --no-create-home --home /nonexistent --gecos 'www-data user' --shell /bin/false --uid 82 www-data #RUN adduser --system --no-create-home --home /nonexistent --gecos 'www-data user' --shell /bin/false --uid 82 www-data
RUN usermod -u 82 -o www-data RUN usermod -u $UID -o www-data
RUN apt update \ RUN apt update \
&& apt -y install libmagickcore-6.q16-6-extra ffmpeg imagemagick ghostscript \ && apt -y install libmagickcore-6.q16-6-extra ffmpeg imagemagick ghostscript \
&& apt clean && apt clean
+8 -2
View File
@@ -1,5 +1,11 @@
FROM nginx:alpine #FROM nginx:alpine
FROM nginx:bullseye
RUN adduser --system --no-create-home --home /nonexistent --gecos 'www-data user' --shell /bin/false --uid 82 www-data ARG UID=1000
ARG GID=1000
RUN usermod -u $UID -o www-data
#RUN adduser --system --no-create-home --home /nonexistent --gecos 'www-data user' --shell /bin/false --uid $UID www-data
COPY nginx.conf /etc/nginx/nginx.conf COPY nginx.conf /etc/nginx/nginx.conf
+1 -1
View File
@@ -31,7 +31,7 @@ http {
#gzip on; #gzip on;
upstream php-handler { upstream php-handler {
server app:9000; server nextcloud:9000;
} }
+6
View File
@@ -0,0 +1,6 @@
FROM redis:latest
ARG UID=1000
ARG GID=1000
RUN usermod -u $UID -o www-data