initial commit

This commit is contained in:
2022-07-11 19:27:00 +02:00
commit fc1690fb7d
122 changed files with 29578 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
CREATE EXTENSION UNACCENT;

View File

@@ -0,0 +1,8 @@
FROM docker.elastic.co/logstash/logstash-oss:8.1.0-amd64
RUN \
bin/logstash-plugin install logstash-output-gelf \
&& bin/logstash-plugin install logstash-input-gelf
COPY ./pipeline /usr/share/logstash/pipeline/

View File

@@ -0,0 +1,16 @@
input {
gelf {
# input for php logs
port => 12201
add_field => [ 'source', "php" ]
}
}
filter {
}
output {
stdout { }
}

View File

@@ -0,0 +1,16 @@
FROM rabbitmq:3.7-management
ENV DELAYED_MESSAGE_PATH=https://dl.bintray.com/rabbitmq/community-plugins/3.7.x/rabbitmq_delayed_message_exchange/rabbitmq_delayed_message_exchange-20171201-3.7.x.zip
ENV DELAYED_MESSAGE_VERSION=20171201-3.7.x
ENV RABBITMQ_PLUGIN_DIR=/plugins
ENV DELAYED_MESSAGE_TARGET=$RABBITMQ_PLUGIN_DIR/rabbitmq_delayed_message_exchange-$DELAYED_MESSAGE_VERSION.ez
RUN apt update \
&& apt install -y --no-install-recommends wget ca-certificates unzip \
&& cd /tmp && wget $DELAYED_MESSAGE_PATH \
&& unzip rabbitmq_delayed_message_exchange-20171201-3.7.x.zip \
&& mkdir -p $RABBITMQ_PLUGIN_DIR && mv *.ez $DELAYED_MESSAGE_TARGET
RUN rabbitmq-plugins list \
&& rabbitmq-plugins enable --offline rabbitmq_delayed_message_exchange \
&& apt remove -y wget ca-certificates \
&& rm -rf /var/lib/apt/lists/* \

10
docker/nginx/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM nginx
COPY ./public /var/www/app/public
# gz encode builded files
RUN gzip -9 -k -f -r /var/www/app/public/build/*
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf

71
docker/nginx/default.conf Normal file
View File

@@ -0,0 +1,71 @@
upstream phpfcgi {
server php:9000;
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server {
listen 80;
# only for getting traffic from collabora, when opening nginx:8001
listen 8001;
#server_name symfony4;
root /var/www/app/public;
error_log /dev/stderr;
access_log /dev/stdout main;
location / {
index index.php;
try_files $uri /index.php$is_args$args;
}
location /build/ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
gzip_static on;
gzip_types
application/atom+xml
application/geo+json
application/javascript
application/x-javascript
application/json
application/ld+json
application/manifest+json
application/rdf+xml
application/rss+xml
application/xhtml+xml
application/xml
font/eot
font/otf
font/ttf
image/svg+xml
text/css
text/javascript
text/plain
text/xml;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param HTTPS off;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size 16k;
proxy_busy_buffers_size 16k;
http2_push_preload on;
}
location ~ \.php$ {
return 404;
}
}

View File

@@ -0,0 +1,82 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
error_log /dev/stderr;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip off;
#include /etc/nginx/conf.d/*.conf;
# permet l'upload de fichiers
client_max_body_size 3M;
upstream phpfcgi {
server php:9000;
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server {
listen 80;
listen 8001;
#server_name symfony4;
root /var/www/app/public;
error_log /dev/stderr;
access_log /dev/stdout main;
location / {
index index.php;
try_files $uri /index.php$is_args$args;
}
location /build/ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ ^/index\.php(/|$) {
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param HTTPS off;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size 16k;
proxy_busy_buffers_size 16k;
}
location ~ \.php$ {
return 404;
}
}
}

View File

@@ -0,0 +1,13 @@
{
"Servers": {
"1": {
"Name": "Default",
"Group": "Default group",
"Port": 5432,
"Username": "postgres",
"Host": "db",
"MaintenanceDB": "postgres",
"SSLMode": "prefer"
}
}
}

55
docker/php/Dockerfile Normal file
View File

@@ -0,0 +1,55 @@
FROM php:7.4-fpm-buster
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
WORKDIR /var/www/app
# ajoute des utilisateurs ayant le uid 1000
RUN groupadd --gid ${GID} "group${GID}" \
&& useradd --uid ${UID} --gid ${GID} --create-home "user${UID}"
CMD ["php-fpm"]