diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 838a576..ecf6926 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -4,6 +4,10 @@ COPY php.ini /usr/local/etc/php/ COPY docker.conf /usr/local/etc/php-fpm.d/docker.conf COPY .bashrc /root/ +# Copy the entrypoint script +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + # mix RUN apt-get update \ && apt-get install -y build-essential zlib1g-dev default-mysql-client curl gnupg procps vim git unzip libzip-dev libpq-dev \ @@ -53,3 +57,7 @@ RUN git clone https://github.com/seebi/dircolors-solarized EXPOSE 5173 WORKDIR /var/www + +#entrypoint +ENTRYPOINT ["entrypoint.sh"] +CMD ["php-fpm"] \ No newline at end of file diff --git a/.docker/php/entrypoint.sh b/.docker/php/entrypoint.sh new file mode 100644 index 0000000..99b8f61 --- /dev/null +++ b/.docker/php/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +# Set permissions for Laravel directories +chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache +chmod -R 775 /var/www/storage /var/www/bootstrap/cache + +# permissions for PHPMyAdmin +mkdir -p /sessions + +chmod 777 /sessions + +exec "$@" \ No newline at end of file