first docker draft

This commit is contained in:
2022-04-25 10:12:27 +02:00
commit 8eaa2a1143
33 changed files with 1497 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mMYSQL\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on
+12
View File
@@ -0,0 +1,12 @@
[client]
default-character-set=utf8
[mysqld]
max_allowed_packet=500M
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
[mysql]
default-character-set=utf8
+5
View File
@@ -0,0 +1,5 @@
FROM nginx:latest
COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ./bashrc /root/.bashrc
COPY ./inputrc /root/.inputrc
+3
View File
@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
+61
View File
@@ -0,0 +1,61 @@
server {
listen 80;
root /var/www/html/performance-art.fr/public_html;
index index.html index.php;
server_name dev.performance-art.fr;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log on;
error_log /var/log/nginx/error.log error;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpd7:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_read_timeout 150;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
root /var/www/html/performance-art.fr/static_html;
server_name static.performance-art.fr;
index index.html index.js index.css index.json index.woff index.ttf; # index.ico index.jpg index.png index.gif index.jpeg
# rewrite ^/modules/(.*)\.(css|js)$ /modules/$1/index.$2 last;
# rewrite ^/sites/all/modules/(.*)\.(css|js)$ /sites/all/modules/$1/index.$2 last;
rewrite ^/(.*)/(.*)\.(css|js|png|woff|ttf|ico|gif)$ /$1/$2/index.$3;
rewrite ^/analytics.js$ /analytics/index.js;
rewrite ^/sites/default/files/styles/(.*)\.(ico|jpeg|jpg|gif|png)$ /sites/default/files/styles/$1/index.$2 last;
rewrite ^/sites/all/themes/gui/perfarttimeline/images/blank.gif$ /sites/all/themes/gui/perfarttimeline/images/blank/index.gif last;
charset utf-8;
access_log on;
error_log /var/log/nginx/error.log error;
}
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on
+5
View File
@@ -0,0 +1,5 @@
FROM nginx:latest
COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ./bashrc /root/.bashrc
COPY ./inputrc /root/.inputrc
+3
View File
@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
+16
View File
@@ -0,0 +1,16 @@
server {
listen 80;
root /var/www/html/performance-art.fr/static_html;
index index.html index.js index.css index.json index.woff index.ttf index.png index.gif;
server_name static.performance-art.fr;
rewrite ^/(fr|en)/(sites|modules|misc)/(.*)$ /$2/$3 last;
rewrite ^/(fr|en)/perfart/ajax/(.*)$ /$1/perfart/ajax/$2.json last;
charset utf-8;
access_log on;
error_log /var/log/nginx/error.log error;
}
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on
+30
View File
@@ -0,0 +1,30 @@
FROM node:lts-alpine
RUN apk update && apk --no-cache add shadow && \
usermod -u 1001 node && \
groupmod -g 1001 node
RUN find / -group 1000 -exec chgrp -h node {} \;
RUN find / -user 1000 -exec chown -h node {} \;
ARG USER_UID
ARG USER_UNAME
ARG USER_GID
ARG USER_GNAME
# RUN addgroup -g 1000 gdp && \
# adduser -h /home/gdp -D -u 1000 gdp && \
RUN adduser -u ${USER_UID} -G users -s /bin/sh -D ${USER_UNAME}
# chown -R gdp:gdp /home/gdp
USER ${USER_UNAME}
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
COPY ./client-entrypoint.sh /usr/local/bin
USER root
RUN chmod +x /usr/local/bin/client-entrypoint.sh
USER ${USER_UNAME}
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
+3
View File
@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mNODE\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# cat /etc/passwd|grep 1000
cd /app
# echo "Cleaning node_modules"
# rm -rf node_modules
#
# echo "Cleaning npm cache"
# npm cache clean --f
#
# echo "Npm install"
# npm install
echo "Npm Clean Install"
npm ci
echo "Run npm dev"
npm run dev
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on
+74
View File
@@ -0,0 +1,74 @@
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
mysql-client \
zip \
libzip-dev && \
# docker-php-ext-install -j$(nproc) iconv && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
apt-get install -y imagemagick libmagickwand-dev && \
pecl install imagick && docker-php-ext-enable imagick && \
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-install pdo_mysql zip && \
docker-php-ext-install opcache && \
docker-php-ext-install bcmath && \
apt-get install -y git vim && \
pecl install redis-4.3.0 && \
pecl install xdebug-2.7.0 && \
docker-php-ext-enable redis xdebug
RUN export COMPOSER_HOME=/usr/local/composer && \
curl -sS https://getcomposer.org/installer \
| php -- --install-dir=/usr/local/bin --filename=composer
# in this case (D7) drush launcher is not working don't know why.
# Replaced by an alias of drush installed with composer
# https://www.drupal.org/node/1302418#comment-10710726
# curl https://drupalconsole.com/installer \
# -L -o /usr/local/bin/drupal && \
# chmod +x /usr/local/bin/drupal && \
# curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar \
# -L -o /usr/local/bin/drush && \
# chmod +x /usr/local/bin/drush
# RUN apt-get install -y curl && \
# curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
# echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
# apt-get update && \
# apt-get install -y nodejs yarn
RUN apt-get install -y rsyslog
COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
# ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
# COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
# COPY ./bashrc /root/.bashrc
# COPY ./inputrc /root/.inputrc
ARG USER_UID
ARG USER_UNAME
ARG USER_GID
ARG USER_GNAME
RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
groupadd -g ${USER_GID} ${USER_GNAME} &&\
useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
chown --changes --silent --no-dereference --recursive \
--from=33:33 ${USER_UID}:${USER_GID} \
/home/${USER_UNAME}
# /.composer \
# /var/run/php-fpm \
# /var/lib/php/sessions \
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
USER ${USER_UNAME}
+6
View File
@@ -0,0 +1,6 @@
PS1='\e[36m\e[1mPHP-7.3\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
alias drush="php ./vendor/bin/drush"
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on
+9
View File
@@ -0,0 +1,9 @@
memory_limit = 2048M
upload_max_filesize = 50M
post_max_size = 50M
;max_execution_time = 150
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = debug
+1
View File
@@ -0,0 +1 @@
local7.* /var/log/drupal.log
+3
View File
@@ -0,0 +1,3 @@
FROM redis:4
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
+2
View File
@@ -0,0 +1,2 @@
maxmemory 1gb
maxmemory-policy allkeys-lru