conteneurisation de l'appli

This commit is contained in:
Rudy
2023-01-07 22:07:15 +01:00
parent b79e8502b1
commit b21f2bc04b
8725 changed files with 1271447 additions and 676 deletions

View File

@ -0,0 +1,53 @@
FROM php:8.1-apache
RUN a2enmod rewrite
ARG PHP_VERSION="8.1"
ENV PHP_VERSION $PHP_VERSION
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get --no-install-recommends -yq install supervisor libicu-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libpng-dev libzip-dev libxpm-dev \
libfreetype6-dev \
vim wget git \
apache2
RUN docker-php-ext-install pdo pdo_mysql zip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl
RUN wget https://getcomposer.org/download/2.0.9/composer.phar \
&& mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer
RUN wget -O- https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& npm install --global yarn
COPY apache.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www
RUN wget -O- https://github.com/boxboat/fixuid/releases/download/v0.5.1/fixuid-0.5.1-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& mkdir -p /etc/fixuid
COPY fixuid.yaml /etc/fixuid/config.yaml
COPY supervisor.ini /etc/supervisor/supervisor.ini
RUN chmod +x /etc/supervisor/supervisor.ini
RUN chown www-data:www-data /etc/supervisor/supervisor.ini
COPY init.sh /init.sh
RUN chmod +x /init.sh
RUN chown www-data:www-data /init.sh
ENTRYPOINT ["/usr/local/bin/fixuid"]
USER www-data
CMD ["/init.sh"]

View File

@ -0,0 +1,16 @@
<VirtualHost *:80>
DocumentRoot /var/www/public
<Directory /var/www/public>
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
CustomLog /dev/stdout combined
ErrorLog /dev/stderr
</VirtualHost>

View File

@ -0,0 +1,4 @@
user: www-data
group: www-data
paths:
- /var/www/var

View File

@ -0,0 +1,9 @@
#!/bin/bash
echo $(whoami)
echo $(pwd)
sleep 5
bin/console d:s:u -f --complete
bin/console d:f:l -n
/usr/bin/supervisord -c /etc/supervisor/supervisor.ini

View File

@ -0,0 +1,12 @@
[supervisord]
nodaemon=true
[program:apache2]
environment=HOSTNAME="%(ENV_HOSTNAME)s"
command = apache2ctl -D FOREGROUND
user = www-data
autostart = true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

View File