Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 25f2f307 authored by Nicolas's avatar Nicolas
Browse files

feat: update dockerfile

parent 74364546
No related branches found
No related tags found
No related merge requests found
......@@ -4,16 +4,13 @@ FROM httpd:2.4.57-alpine3.18
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.0"
LABEL version="1.1"
# Change port and update server name
# Enable proxy and fcgi modules
RUN sed -i \
-e 's/Listen 80/Listen 8000/' \
-e 's/^#ServerName.*/ServerName localhost:8000/' \
/usr/local/apache2/conf/httpd.conf
# Enable proxy and fcgi modules
RUN sed -i \
-e 's/^#\(LoadModule proxy_module modules\/mod_proxy.so\)/\1/' \
-e 's/^#\(LoadModule proxy_fcgi_module modules\/mod_proxy_fcgi.so\)/\1/' \
-e 's/^#\(LoadModule negotiation_module modules\/mod_negotiation.so\)/\1/' \
......
......@@ -4,12 +4,12 @@ FROM nginx:1.25.1-alpine3.17
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.0"
LABEL version="1.1"
# installe les dependances requises
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
openrc
&& apk --no-cache --no-progress add \
"openrc=0.45.2-r7"
# Créé l'utilisateur app
RUN addgroup -g 1000 app \
......@@ -24,8 +24,8 @@ COPY ./nginx/conf/default.conf /etc/nginx/conf.d/
# Créé les répertoies et assigne les droits
RUN mkdir -p /var/www/html /var/log/nginx \
&& chown -R app:app /etc/nginx /var/www/html /var/cache/nginx /var/run/nginx.pid /var/log/nginx \
&& chmod 700 /var/run/nginx.pid
&& chown -R app:app /etc/nginx /var/www/html /var/cache/nginx /var/run/nginx.pid /var/log/nginx \
&& chmod 700 /var/run/nginx.pid
# Modifie le user de l'image
USER app:app
......
......@@ -4,43 +4,44 @@ FROM php:8.2.7-fpm-alpine3.18
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.0"
LABEL version="1.1"
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Update cache system packages
RUN apk --no-cache --no-progress upgrade > /dev/null
# Permet d'installer les dépendances nécessaires à PECL
RUN apk add --no-cache --no-progress $PHPIZE_DEPS
RUN apk --no-cache --no-progress add \
curl \
freetype-dev \
git \
gzip \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
linux-headers \
mysql-client \
oniguruma-dev \
zip
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
$PHPIZE_DEPS \
"curl=8.1.2-r0" \
"freetype-dev=2.13.0-r5" \
"git=2.40.1-r0" \
"gzip=1.12-r1" \
"libjpeg-turbo-dev=2.1.5.1-r3" \
"libpng-dev=1.6.39-r3" \
"libwebp-dev=1.3.0-r2" \
"libzip-dev=1.9.2-r2" \
"linux-headers=6.3-r0" \
"mysql-client=10.11.4-r0" \
"oniguruma-dev=6.9.8-r1" \
"zip=3.0-r12"
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp
RUN docker-php-ext-install -j$(nproc) \
RUN docker-php-ext-install -j"$(nproc)" \
bcmath \
gd \
mbstring \
pdo_mysql \
zip
# Définition de l'option SHELL et utilisation de pipe dans une instruction RUN
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -sS https://getcomposer.org/installer | \
php -- --version=2.5.8 --install-dir=/usr/local/bin --filename=composer
......@@ -52,14 +53,14 @@ RUN pecl install xdebug-3.2.1 \
# Création de l'utilisateur app
RUN addgroup -g 1000 app \
&& adduser -D -H -h /var/www -s /sbin/nologin -G app -u 1000 app
&& adduser -D -H -h /var/www -s /sbin/nologin -G app -u 1000 app
# Copie les fichiers de configuration
COPY ./phpfpm/conf/php.ini /usr/local/etc/php/
COPY ./phpfpm/conf/php-fpm.conf /usr/local/etc/
RUN mkdir -p /var/www/html /sock /var/log/php \
&& chown -R app:app /var/www /usr/local/etc /sock /var/log/php
&& chown -R app:app /var/www /usr/local/etc /sock /var/log/php
RUN chown -R app:app /var/www/html/
......
......@@ -4,45 +4,44 @@ FROM php:8.2.7-fpm-alpine3.18
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.0"
LABEL version="1.1"
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Update cache system packages
RUN apk --no-cache --no-progress upgrade > /dev/null
# Permet d'installer les dépendances nécessaires à PECL
RUN apk add --no-cache --no-progress $PHPIZE_DEPS
RUN apk --no-cache --no-progress add \
curl \
freetype-dev \
git \
gzip \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
linux-headers \
mysql-client \
nodejs \
npm \
oniguruma-dev \
zip
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
$PHPIZE_DEPS \
"curl=8.1.2-r0" \
"freetype-dev=2.13.0-r5" \
"git=2.40.1-r0" \
"gzip=1.12-r1" \
"libjpeg-turbo-dev=2.1.5.1-r3" \
"libpng-dev=1.6.39-r3" \
"libwebp-dev=1.3.0-r2" \
"libzip-dev=1.9.2-r2" \
"linux-headers=6.3-r0" \
"mysql-client=10.11.4-r0" \
"oniguruma-dev=6.9.8-r1" \
"zip=3.0-r12"
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp
RUN docker-php-ext-install -j$(nproc) \
RUN docker-php-ext-install -j"$(nproc)" \
bcmath \
gd \
mbstring \
pdo_mysql \
zip
# Définition de l'option SHELL et utilisation de pipe dans une instruction RUN
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -sS https://getcomposer.org/installer | \
php -- --version=2.5.8 --install-dir=/usr/local/bin --filename=composer
......@@ -52,24 +51,24 @@ RUN pecl install xdebug-3.2.1 \
&& echo "xdebug.mode=debug,coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# && echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN touch /var/www/html/phpunit-report.xml /var/www/html/phpunit-coverage.xml
RUN chmod 777 /var/www/html/phpunit-report.xml /var/www/html/phpunit-coverage.xml
RUN touch /var/www/html/phpunit-report.xml /var/www/html/phpunit-coverage.xml \
&& chmod 777 /var/www/html/phpunit-report.xml /var/www/html/phpunit-coverage.xml
# Création de l'utilisateur app
RUN addgroup -g 1000 app \
&& adduser -D -H -h /var/www -s /sbin/nologin -G app -u 1000 app
&& adduser -D -H -h /var/www -s /sbin/nologin -G app -u 1000 app
COPY . .
RUN composer install
RUN npm install
RUN composer install \
&& npm install
# Copie les fichiers de configuration
COPY ./.docker/phpfpm/conf/php.ini /usr/local/etc/php/
COPY ./.docker/phpfpm/conf/php-fpm.conf /usr/local/etc/
RUN mkdir -p /var/www/html /sock /var/log/php \
&& chown -R app:app /var/www /usr/local/etc /sock /var/log/php
&& chown -R app:app /var/www /usr/local/etc /sock /var/log/php
RUN chown -R app:app /var/www/html/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment