Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elmsln/HAXcms
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Dec 11, 2019
2 parents ca21581 + 9b0412c commit 68159aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM php:7.3-apache

FROM php:7.4-apache
# Adds jpeg-support for gd
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
Expand All @@ -8,8 +7,13 @@ RUN apt-get update && apt-get install -y \
git \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

# Enable rewrite
RUN a2enmod rewrite
# Copy custom apache conf
COPY ./system/docker/apache2.conf /etc/apache2/apache2.conf

# Customize the php entrypoint to clean up permissions
COPY ./system/docker/docker-php-entrypoint /usr/local/bin/
# Make sure the entrypoint is executable
RUN chmod +x /usr/local/bin/docker-php-entrypoint
# Copy HAXcms into the web root directory
COPY --chown=www-data:www-data . /var/www/html
12 changes: 12 additions & 0 deletions system/docker/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

echo "updating permissions"
find /var/www/html -not -user www-data -execdir chown www-data:www-data {} \+

exec "$@"

0 comments on commit 68159aa

Please sign in to comment.