diff --git a/Dockerfile b/Dockerfile index 7fb3443..f693e39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,8 +51,7 @@ RUN apk add --no-progress --no-cache \ && chmod +x /usr/local/bin/composer \ && composer global require --no-progress --no-suggest -- hirak/prestissimo \ && mkdir -p /flarum/app \ - && chown -R $UID:$GID /flarum \ - && COMPOSER_CACHE_DIR="/tmp" su-exec $UID:$GID composer create-project --stability=beta --no-progress -- flarum/flarum /flarum/app $VERSION \ + && COMPOSER_CACHE_DIR="/tmp" composer create-project --stability=beta --no-progress -- flarum/flarum /flarum/app $VERSION \ && composer clear-cache \ && rm -rf /flarum/.composer /tmp/* \ && apk del --purge curl diff --git a/rootfs/usr/local/bin/startup b/rootfs/usr/local/bin/startup index 0e55061..80575df 100644 --- a/rootfs/usr/local/bin/startup +++ b/rootfs/usr/local/bin/startup @@ -17,7 +17,10 @@ sed -i "s//${PHP_MEMORY_LIMIT}/g" /etc/php7/php-fpm.conf sed -i "s//${OPCACHE_MEMORY_LIMIT}/g" /etc/php7/conf.d/00_opcache.ini # Set permissions -chown -R "${UID}:${GID}" /services /var/log /var/lib/nginx +for folder in /services /var/log /var/lib/nginx; do + find ${folder} ! -user "${UID}" -exec chown "${UID}:${GID}" {} \; + find ${folder} ! -group "${GID}" -exec chown "${UID}:${GID}" {} \; +done # Set log output to STDOUT if wanted (LOG_TO_STDOUT=true) if [ "${LOG_TO_STDOUT}" = true ]; then @@ -110,9 +113,9 @@ else -e "s||${FLARUM_TITLE}|g" /flarum/app/config.yml # Install flarum - chown -R "${UID}:${GID}" /flarum + find /flarum ! -user "${UID}" -exec chown "${UID}:${GID}" {} \; + find /flarum ! -group "${GID}" -exec chown "${UID}:${GID}" {} \; su-exec "${UID}:${GID}" php /flarum/app/flarum install --file=/flarum/app/config.yml - echo "[INFO] End of flarum installation" fi @@ -120,5 +123,4 @@ fi find /flarum ! -user "${UID}" -exec chown "${UID}:${GID}" {} \; find /flarum ! -group "${GID}" -exec chown "${UID}:${GID}" {} \; -# RUN ! exec su-exec "${UID}:${GID}" /bin/s6-svscan /services