Merge branch 'master' into dependabot/npm_and_yarn/mixin-deep-1.3.2

This commit is contained in:
Nicolas Maillat
2019-11-13 10:24:51 +01:00
committed by GitHub
10 changed files with 116 additions and 97 deletions

View File

@@ -86,6 +86,18 @@ COPY grammar /var/alchemy/grammar
COPY templates-profiler /var/alchemy/templates-profiler COPY templates-profiler /var/alchemy/templates-profiler
COPY templates /var/alchemy/templates COPY templates /var/alchemy/templates
COPY tests /var/alchemy/tests COPY tests /var/alchemy/tests
RUN mkdir -p /var/alchemy/Phraseanet/logs \
&& chmod -R 777 /var/alchemy/Phraseanet/logs \
&& mkdir -p /var/alchemy/Phraseanet/cache \
&& chmod -R 777 /var/alchemy/Phraseanet/cache \
&& mkdir -p /var/alchemy/Phraseanet/datas \
&& chmod -R 777 /var/alchemy/Phraseanet/datas \
&& mkdir -p /var/alchemy/Phraseanet/tmp \
&& chmod -R 777 /var/alchemy/Phraseanet/tmp \
&& mkdir -p /var/alchemy/Phraseanet/www/custom \
&& chmod -R 777 /var/alchemy/Phraseanet/www/custom \
&& mkdir -p /var/alchemy/Phraseanet/config \
&& chmod -R 777 /var/alchemy/Phraseanet/config
# Phraseanet # Phraseanet
FROM php:7.0-fpm-stretch as phraseanet-fpm FROM php:7.0-fpm-stretch as phraseanet-fpm
@@ -129,6 +141,23 @@ RUN apt-get update \
&& docker-php-source delete \ && docker-php-source delete \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& php -r "unlink('composer-setup.php');"
# Node Installation (node + yarn)
# Reference :
# https://linuxize.com/post/how-to-install-node-js-on-ubuntu-18.04/
# https://yarnpkg.com/lang/en/docs/install/#debian-stable
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt install -y nodejs \
&& 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 --no-install-recommends yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
RUN mkdir /entrypoint /var/alchemy \ RUN mkdir /entrypoint /var/alchemy \
&& useradd -u 1000 app \ && useradd -u 1000 app \
&& mkdir -p /home/app/.composer \ && mkdir -p /home/app/.composer \
@@ -136,18 +165,6 @@ RUN mkdir /entrypoint /var/alchemy \
COPY --from=builder --chown=app /var/alchemy /var/alchemy/Phraseanet COPY --from=builder --chown=app /var/alchemy /var/alchemy/Phraseanet
ADD ./docker/phraseanet/ / ADD ./docker/phraseanet/ /
RUN mkdir -p /var/alchemy/Phraseanet/logs \
&& chmod -R 777 /var/alchemy/Phraseanet/logs \
&& mkdir -p /var/alchemy/Phraseanet/cache \
&& chmod -R 777 /var/alchemy/Phraseanet/cache \
&& mkdir -p /var/alchemy/Phraseanet/datas \
&& chmod -R 777 /var/alchemy/Phraseanet/datas \
&& mkdir -p /var/alchemy/Phraseanet/tmp \
&& chmod -R 777 /var/alchemy/Phraseanet/tmp \
&& mkdir -p /var/alchemy/Phraseanet/www/custom \
&& chmod -R 777 /var/alchemy/Phraseanet/www/custom \
&& mkdir -p /var/alchemy/Phraseanet/config \
&& chmod -R 777 /var/alchemy/Phraseanet/config
WORKDIR /var/alchemy/Phraseanet WORKDIR /var/alchemy/Phraseanet
ENTRYPOINT ["/phraseanet-entrypoint.sh"] ENTRYPOINT ["/phraseanet-entrypoint.sh"]
CMD ["/boot.sh"] CMD ["/boot.sh"]

View File

@@ -63,14 +63,12 @@ The docker distribution come with 3 differents containers :
## How to build ## How to build
The three images can be built respectively with these commands : You can build all the images with the following command at the root directory :
# nginx server ./build <TAG>
docker build --target phraseanet-nginx -t local/phraseanet-nginx .
# php-fpm application It will build and tag the following images :
docker build --target phraseanet-fpm -t local/phraseanet-fpm .
# worker
docker build --target phraseanet-worker -t local/phraseanet-worker .
local/phraseanet-worker:<TAG>
local/phraseanet-fpm:<TAG>
local/phraseanet-nginx:<TAG>

11
build.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# nginx server
docker build --target phraseanet-nginx -t local/phraseanet-nginx:$1 .
# php-fpm application
docker build --target phraseanet-fpm -t local/phraseanet-fpm:$1 .
# worker
docker build --target phraseanet-worker -t local/phraseanet-worker:$1 .

View File

@@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
cat nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" > /etc/nginx/nginx.conf set -xe
cat nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" > /etc/nginx/conf.d/default.conf
nginx -g "daemon off;" nginx -g "daemon off;"

View File

@@ -0,0 +1,31 @@
user app;
worker_processes 1;
error_log /var/log/ngnix_error.log info;
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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

View File

@@ -1,85 +1,39 @@
user app; upstream backend {
worker_processes auto; server phraseanet:9000;
#error_log /var/log/ngnix_error.log info;
error_log /dev/stdout info;
pid /var/run/nginx.pid;
#daemon off;
events {
worker_connections 1024;
multi_accept on;
} }
http { server {
include /etc/nginx/mime.types; listen 80;
default_type application/octet-stream; root /var/alchemy/Phraseanet/www;
server_tokens off;
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' index index.php;
'$status $body_bytes_sent "$http_referer" ' client_max_body_size $MAX_BODY_SIZE;
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main; location /api {
rewrite ^(.*)$ /api.php/$1 last;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
reset_timedout_connection on;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300;
resolver 127.0.0.11;
upstream backend {
server phraseanet:9000;
} }
server { location / {
listen 80; # First attempt to serve request as file, then
server_name localhost; # as directory, then fall back to index.html
error_log on; try_files $uri $uri/ @rewriteapp;
access_log on; }
root /var/alchemy/Phraseanet/www;
index index.php; location @rewriteapp {
client_max_body_size $MAX_BODY_SIZE; rewrite ^(.*)$ /index.php/$1 last;
}
location /api { # PHP scripts -> PHP-FPM server listening on 127.0.0.1:9000
rewrite ^(.*)$ /api.php/$1 last; location ~ ^/(index|index_dev|api)\.php(/|$) {
} fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / { location ~ ^/(status|ping)$ {
# First attempt to serve request as file, then fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# as directory, then fall back to index.html fastcgi_index index.php;
try_files $uri $uri/ @rewriteapp; include fastcgi_params;
} fastcgi_pass backend;
location @rewriteapp {
rewrite ^(.*)$ /index.php/$1 last;
}
# PHP scripts -> PHP-FPM server listening on 127.0.0.1:9000
location ~ ^/(index|index_dev|api)\.php(/|$) {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/(status|ping)$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass backend;
}
} }
} }

View File

@@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
set -xe
chown -R app:app /var/alchemy/Phraseanet/config
chown -R app:app /var/alchemy/Phraseanet/datas
chown -R app:app /var/alchemy/Phraseanet/tmp
chown -R app:app /var/alchemy/Phraseanet/www/thumbnails
FILE=/var/alchemy/Phraseanet/config/configuration.yml FILE=/var/alchemy/Phraseanet/config/configuration.yml
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "$FILE exist, skip setup." echo "$FILE exist, skip setup."

View File

@@ -5,4 +5,4 @@ set -e
envsubst < /php.ini.sample > /usr/local/etc/php/php.ini envsubst < /php.ini.sample > /usr/local/etc/php/php.ini
envsubst < /php-fpm.conf.sample > /usr/local/etc/php-fpm.conf envsubst < /php-fpm.conf.sample > /usr/local/etc/php-fpm.conf
docker-php-entrypoint $@ bash -e docker-php-entrypoint $@

View File

@@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
mkdir /var/alchemy/Phraseanet/tmp/locks && chown -R app:app /var/alchemy/Phraseanet/tmp
runuser app -c 'php /var/alchemy/Phraseanet/bin/console task-manager:scheduler:run' runuser app -c 'php /var/alchemy/Phraseanet/bin/console task-manager:scheduler:run'

View File

@@ -5285,7 +5285,6 @@ jquery-simplecolorpicker@^0.3.1:
"jquery-treeview@git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e": "jquery-treeview@git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e":
version "1.4.2" version "1.4.2"
uid "1e9e5a49d2875b878801e904cd08c2d25e85af1e"
resolved "git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e" resolved "git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e"
"jquery-treeview@https://github.com/alchemy-fr/jquery-treeview.git": "jquery-treeview@https://github.com/alchemy-fr/jquery-treeview.git":