Add php 7.2,7.3

This commit is contained in:
2023-01-08 12:20:14 +02:00
parent be8056dfba
commit 3014750ab6
3 changed files with 188 additions and 0 deletions

View File

@@ -22,6 +22,20 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push 7.2
uses: docker/build-push-action@v3
with:
file: "./docker/7.2/Dockerfile"
push: true
tags: "${{env.BUILDKIT_IMAGE}}:7.2"
-
name: Build and push 7.3
uses: docker/build-push-action@v3
with:
file: "./docker/7.3/Dockerfile"
push: true
tags: "${{env.BUILDKIT_IMAGE}}:7.3"
- -
name: Build and push 7.4 name: Build and push 7.4
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3

87
docker/7.2/Dockerfile Normal file
View File

@@ -0,0 +1,87 @@
FROM php:7.2-fpm
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV DOMAIN=_
ENV CLIENT_MAX_BODY_SIZE=15M
ENV NODE_VERSION=17.x
ARG HOST_UID=1000
ENV USER=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmemcached-dev \
libzip-dev \
libpng-dev \
libonig-dev \
libxml2-dev \
librdkafka-dev \
libpq-dev \
openssh-server \
zip \
unzip \
supervisor \
sqlite3 \
nano \
cron
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
# Install Node
RUN apt-get install -y nodejs
# Install nginx
RUN apt-get update && apt-get install -y nginx
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions zip, mbstring, exif, bcmath, intl
RUN docker-php-ext-configure gd
RUN docker-php-ext-install zip mbstring exif pcntl bcmath -j$(nproc) gd intl
# Install Redis and enable it
RUN pecl install redis && docker-php-ext-enable redis
# Install the php memcached extension
RUN pecl install memcached && docker-php-ext-enable memcached
# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
# Install the PHP pdo_pgsql extention
RUN docker-php-ext-install pdo_pgsql
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Set working directory
WORKDIR $WORKDIR
RUN rm -Rf /var/www/* && \
mkdir -p /var/www/html
ADD src/index.php $WORKDIR/index.php
ADD src/conf/nginx/default.conf /etc/nginx/sites-available/default
ADD src/php.ini $PHP_INI_DIR/conf.d/
ADD src/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN ln -s /usr/local/bin/entrypoint.sh /
ENTRYPOINT ["entrypoint.sh"]
RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data
RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000 80
CMD [ "entrypoint" ]

87
docker/7.3/Dockerfile Normal file
View File

@@ -0,0 +1,87 @@
FROM php:7.3-fpm
ARG WORKDIR=/var/www/html
ENV DOCUMENT_ROOT=${WORKDIR}
ENV LARAVEL_PROCS_NUMBER=1
ENV DOMAIN=_
ENV CLIENT_MAX_BODY_SIZE=15M
ENV NODE_VERSION=17.x
ARG HOST_UID=1000
ENV USER=www-data
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmemcached-dev \
libzip-dev \
libpng-dev \
libonig-dev \
libxml2-dev \
librdkafka-dev \
libpq-dev \
openssh-server \
zip \
unzip \
supervisor \
sqlite3 \
nano \
cron
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
# Install Node
RUN apt-get install -y nodejs
# Install nginx
RUN apt-get update && apt-get install -y nginx
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions zip, mbstring, exif, bcmath, intl
RUN docker-php-ext-configure gd
RUN docker-php-ext-install zip mbstring exif pcntl bcmath -j$(nproc) gd intl
# Install Redis and enable it
RUN pecl install redis && docker-php-ext-enable redis
# Install the php memcached extension
RUN pecl install memcached && docker-php-ext-enable memcached
# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
# Install the PHP pdo_pgsql extention
RUN docker-php-ext-install pdo_pgsql
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Set working directory
WORKDIR $WORKDIR
RUN rm -Rf /var/www/* && \
mkdir -p /var/www/html
ADD src/index.php $WORKDIR/index.php
ADD src/conf/nginx/default.conf /etc/nginx/sites-available/default
ADD src/php.ini $PHP_INI_DIR/conf.d/
ADD src/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN ln -s /usr/local/bin/entrypoint.sh /
ENTRYPOINT ["entrypoint.sh"]
RUN usermod -u ${HOST_UID} www-data
RUN groupmod -g ${HOST_UID} www-data
RUN chmod -R 755 $WORKDIR
RUN chown -R www-data:www-data $WORKDIR
EXPOSE 9000 80
CMD [ "entrypoint" ]