prevent plugin volume to have ownerships overwritten by docker

This commit is contained in:
asus
2024-02-06 15:46:43 +01:00
parent 00473e1288
commit 24aac70ac8
4 changed files with 27 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ services:
- WP_URL=${WP_URL}
- SERVER_MAX_UPLOAD_SIZE=${SERVER_MAX_UPLOAD_SIZE}
- WP_VOLUME_DIR=${WP_VOLUME_DIR}
- WP_VOLUME_PLUGINS=${WP_VOLUME_PLUGINS}
- NG_CERTS_DIR=${NG_CERTS_DIR}
image: nginx
container_name: nginx_container
@@ -64,6 +65,8 @@ services:
build:
context: ./requirements/wordpress
args:
- WP_VOLUME_DIR=${WP_VOLUME_DIR}
- WP_VOLUME_PLUGINS=${WP_VOLUME_PLUGINS}
- SERVER_MAX_UPLOAD_SIZE=${SERVER_MAX_UPLOAD_SIZE}
- SERVER_EXECUTION_TIME=${SERVER_EXECUTION_TIME}
image: wordpress

View File

@@ -23,9 +23,16 @@ RUN adduser -S www-data && \
# ARG variables are not persistent after the build process, in opposite to ENV
ARG WP_URL
ARG WP_VOLUME_DIR
ARG WP_VOLUME_PLUGINS
ARG NG_CERTS_DIR
ARG SERVER_MAX_UPLOAD_SIZE
# IS IT USEFUL ?
# # create and empty volumes dir
# RUN mkdir -p ${WP_VOLUME_DIR} ${WP_VOLUME_PLUGINS} && \
# rm -rf ${WP_VOLUME_DIR}/* ${WP_VOLUME_PLUGINS}/*
# replace WP_URL
RUN sed -i "s/\${WP_URL}/${WP_URL}/g" /etc/nginx/http.d/nginx_http_server.conf
# replace max file size upload

View File

@@ -26,9 +26,17 @@ RUN rm -rf /var/lib/apt/lists/*
COPY ./conf/www.conf /etc/php7/php-fpm.d/
RUN mkdir /run/php/
ARG WP_VOLUME_DIR
ARG WP_VOLUME_PLUGINS
ARG SERVER_MAX_UPLOAD_SIZE
ARG SERVER_EXECUTION_TIME
# IS IT USEFUL ?
# # create and empty volumes dir
# RUN mkdir -p ${WP_VOLUME_DIR} ${WP_VOLUME_PLUGINS} && \
# rm -rf ${WP_VOLUME_DIR}/* ${WP_VOLUME_PLUGINS}/*
# replace max file size upload and execution time
RUN sed -i "s/\(upload_max_filesize = \).*\(M\)/\1${SERVER_MAX_UPLOAD_SIZE}\2/g" /etc/php7/php.ini && \
sed -i "s/\(post_max_size = \).*\(M\)/\1${SERVER_MAX_UPLOAD_SIZE}\2/g" /etc/php7/php.ini && \