Commit 97a3f3b5 authored by Sergey Shadrin's avatar Sergey Shadrin

Merge branch '10.4.x-docker' into '10.4.x'

Added dockerfile and docker-compose

See merge request !2
parents 8e929ded b74920ef

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

sites/*/files
!sites/*/files/
sites/*/files/*
!sites/*/files/translations
sites/*/private
sites/*/settings.php
app/sites/*/files
!app/sites/*/files/
app/sites/*/files/*
!app/sites/*/files/translations
app/sites/*/private
app/sites/*/settings.php
# Exclude update module
!core/modules/update/update.info.yml
core/modules/update
app/core/modules/update
!app/core/modules/update/update.info.yml
# Exclude IDE specific directories.
.idea
.vscode
# Exclude composer plugin vendor packages.
vendor/drupal/core-composer-scaffold
vendor/drupal/core-project-message
vendor/oomphinc/composer-installers-extender
vendor/cweagans/composer-patches
vendor/wikimedia/composer-merge-plugin
app/vendor/drupal/core-composer-scaffold
app/vendor/drupal/core-project-message
app/vendor/oomphinc/composer-installers-extender
app/vendor/cweagans/composer-patches
app/vendor/wikimedia/composer-merge-plugin
# Docker related files.
/provision/local/docker-runtime/
/provision/local/.env
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
FROM nginx:stable-alpine as nginx-base
RUN apk add --no-cache bash
COPY provision/docker-images/nginx/nginx.conf /etc/nginx/nginx.conf
COPY provision/docker-images/nginx/vhost.conf /opt/vhost.conf
COPY provision/docker-images/nginx/docker-entrypoint.sh /usr/local/bin/
RUN chown -R nginx:0 /var/cache/nginx && \
chmod -R g+w /var/cache/nginx && \
chown -R nginx:0 /etc/nginx && \
chmod -R g+w /etc/nginx
EXPOSE 8080
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["nginx"]
FROM php:8.3-fpm-alpine as php-fpm-base
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN set -xe; \
apk add --update --no-cache -t .php-run-deps \
bash \
freetype \
icu-libs \
libbz2 \
libevent \
libjpeg-turbo \
libjpeg-turbo-utils \
libmcrypt \
libpng \
libuuid \
libwebp \
libxml2 \
libxslt \
libzip \
yaml && \
apk add --update --no-cache -t .php-build-deps \
g++ \
make \
autoconf \
libzip-dev \
icu-dev \
bzip2-dev \
freetype-dev \
libmcrypt-dev \
jpeg-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
unixodbc-dev \
yaml-dev && \
docker-php-ext-install \
bcmath \
bz2 \
calendar \
exif \
intl \
mysqli \
opcache \
pcntl \
pdo_mysql \
zip && \
docker-php-ext-configure gd \
--with-webp \
--with-freetype \
--with-jpeg && \
NPROC=$(getconf _NPROCESSORS_ONLN) && \
docker-php-ext-install "-j${NPROC}" gd && \
pecl channel-update pecl.php.net && \
pecl install yaml-2.2.3 \
apcu-5.1.23 \
uploadprogress-2.0.2 \
mcrypt-1.0.7 && \
docker-php-ext-enable yaml \
apcu \
uploadprogress \
mcrypt && \
apk del --purge .php-build-deps && \
rm -rf \
/usr/src/php/ext/ast \
/usr/src/php/ext/uploadprogress \
/usr/include/php \
/usr/lib/php/build \
/tmp/* \
/root/.composer \
/var/cache/apk/*
USER www-data
FROM php-fpm-base as cli-base
USER root
RUN apk add --update --no-cache -t .build-deps \
git \
openssh-client \
ca-certificates \
patch \
mariadb-client
RUN wget -qO- https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --2
USER www-data
WORKDIR /var/www/html
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["tail -f /dev/null"]
FROM cli-base as builder
COPY app/composer.json app/composer.lock /var/www/html/
COPY app/patches /var/www/html/patches
COPY app /var/www/html
FROM nginx-base as nginx
COPY --from=builder --chown=root:root /var/www/html/docroot /var/www/html/docroot
FROM php-fpm-base as php-fpm
COPY --from=builder --chown=root:root /var/www/html /var/www/html
FROM cli-base as cli
COPY --from=builder --chown=root:root /var/www/html /var/www/html
FROM php-fpm-base as php-fpm-local
USER root
RUN apk add --update --no-cache -t .php-build-deps \
g++ \
make \
linux-headers \
autoconf && \
pecl install xdebug-3.3.1 && \
apk del --purge .php-build-deps && \
rm -rf \
/usr/src/php/ext/ast \
/usr/src/php/ext/uploadprogress \
/usr/include/php \
/usr/lib/php/build \
/tmp/* \
/root/.composer \
/var/cache/apk/*
COPY provision/docker-images/php-fpm-local/docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["php-fpm"]
FROM cli-base as cli-local
USER root
RUN echo "export PATH=$PATH:/var/www/html/vendor/bin" >> ~/.bashrc
COPY provision/docker-images/cli-local/docker-entrypoint.sh /usr/local/bin/
COPY provision/docker-images/cli-local/php-cli.ini /usr/local/etc/php/conf.d/cli.ini
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["tail","-f","/dev/null"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment