Skip to content

Commit

Permalink
Fix Docker image, chown in place
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Apr 2, 2024
1 parent eabcb6a commit 37f003c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LICENSE
.git
.gitignore
.github
docker
.env.local
.env.test.local
phpunit.xml.dist
Expand Down
20 changes: 8 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,22 @@ RUN apk --update --virtual build-deps-imap add --no-cache imap-dev openssl-dev k
&& apk del build-deps-imap \
&& rm -rf /tmp/*

# PHP-FPM healthcheck
RUN set -xe && echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf
RUN curl https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/v0.5.0/php-fpm-healthcheck \
-o /usr/local/bin/php-fpm-healthcheck -s \
&& chmod +x /usr/local/bin/php-fpm-healthcheck

# Davis installation
ADD . /var/www/davis
ADD --chown=${FPM_USER} . /var/www/davis
WORKDIR /var/www/davis

# Install Composer 2, then dependencies
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN APP_ENV=prod COMPOSER_ALLOW_SUPERUSER=1 composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader

# PHP-FPM healthcheck
RUN set -xe && echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf
RUN curl https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/v0.5.0/php-fpm-healthcheck \
-o /usr/local/bin/php-fpm-healthcheck -s \
&& chmod +x /usr/local/bin/php-fpm-healthcheck

# Cleanup (only useful when using --squash)
RUN docker-php-source delete
RUN rm -rf /usr/local/bin/composer

# Sets the app folder owner as the FPM user
RUN chown -R ${FPM_USER} .
RUN docker-php-source delete && rm -rf /var/www/davis/docker

USER $FPM_USER

Expand Down

0 comments on commit 37f003c

Please sign in to comment.