chill-recipe/Dockerfile

83 lines
2.2 KiB
Docker
Raw Normal View History

2022-06-07 08:16:24 +00:00
FROM php:7.4-fpm-buster AS chill_base_php
ENV POSTGRES_VERSION 14
# default UID for the PHP user
ARG UID=1000
ARG GID=1000
RUN apt update && apt -y --no-install-recommends install wget gnupg \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt update && apt -y --no-install-recommends install \
libicu-dev \
g++ \
postgresql-server-dev-$POSTGRES_VERSION \
libzip-dev libzip4 unzip \
libfreetype6-dev \
libonig-dev `# install oniguruma, required for mbstring` \
libpng-dev \
libjpeg62-turbo-dev \
git \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install intl pdo_pgsql mbstring zip bcmath sockets exif \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apt remove -y wget libicu-dev g++ gnupg libzip-dev \
&& apt autoremove -y \
&& apt purge -y
RUN { \
echo ""; \
echo "memory_limit = 512M"; \
echo ""; \
} >> /usr/local/etc/php/conf.d/memory_limit.ini
RUN { \
echo ""; \
echo "[Date]"; \
echo "date.timezone = Europe/Brussels"; \
echo ""; \
} >> /usr/local/etc/php/conf.d/date.ini
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_MEMORY_LIMIT=-1
ENV COMPOSER_HOME=/var/www/app/.composer
2022-06-07 08:16:24 +00:00
WORKDIR /var/www/app
CMD ["php-fpm"]
FROM chill_base_php AS chill_php
# copy directories
COPY ./bin /var/www/app/bin/.
COPY ./composer.* /var/www/app/
COPY ./config /var/www/app/config/.
COPY ./migrations /var/www/app/migrations/.
COPY ./public /var/www/app/public/.
COPY ./src /var/www/app/src/.
COPY ./templates /var/www/app/templates/.
COPY ./translations /var/www/app/translations/.
COPY ./vendor /var/www/app/vendor/.
COPY ./.env /var/www/app/.env
# import the manifest.json file
COPY ./public/build/manifest.json /var/www/app/public/build/manifest.json
ADD ./entrypoint.sh /.
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENV PHP_FPM_USER=www-data \
PHP_FPM_GROUP=www-data \
SESSION_LIFETIME=10800
CMD [ "php-fpm" ]