Initial docker-compse based configuration.
parent
89e9de4a15
commit
ee906b8e61
|
@ -0,0 +1,21 @@
|
|||
FROM debian:stretch
|
||||
|
||||
ENV HTTPD_PREFIX /usr/local/apache2
|
||||
ENV PATH $HTTPD_PREFIX/bin:$PATH
|
||||
RUN mkdir -p "$HTTPD_PREFIX" \
|
||||
&& chown www-data:www-data "$HTTPD_PREFIX"
|
||||
WORKDIR $HTTPD_PREFIX
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
apache2 curl \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
RUN a2enmod proxy_fcgi ssl rewrite proxy proxy_balancer proxy_http proxy_ajp
|
||||
RUN sed -i '/Global configuration/a \
|
||||
ServerName localhost \
|
||||
' /etc/apache2/apache2.conf
|
||||
EXPOSE 80 443
|
||||
|
||||
RUN rm -f /run/apache2/apache2.pid
|
||||
|
||||
CMD apachectl -DFOREGROUND -e info
|
|
@ -0,0 +1,26 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName monarc.local
|
||||
DocumentRoot /home/www/monarc/public
|
||||
ErrorLog /var/log/apache2/error.log
|
||||
CustomLog /var/log/apache2/access.log Combined
|
||||
|
||||
<FilesMatch .php$>
|
||||
SetHandler "proxy:fcgi://monarc_php:9000"
|
||||
</FilesMatch>
|
||||
|
||||
<Directory /home/www/monarc/public>
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header always set X-Content-Type-Options nosniff
|
||||
Header always set X-XSS-Protection '1; mode=block'
|
||||
Header always set X-Robots-Tag none
|
||||
Header always set X-Frame-Options SAMEORIGIN
|
||||
</IfModule>
|
||||
|
||||
SetEnv APP_ENV dev
|
||||
SetEnv APP_DIR /home/www/monarc
|
||||
</VirtualHost>
|
|
@ -0,0 +1,10 @@
|
|||
-- create databases
|
||||
CREATE DATABASE IF NOT EXISTS `monarc_cli`;
|
||||
CREATE DATABASE IF NOT EXISTS `monarc_common`;
|
||||
|
||||
-- create root user and grant rights
|
||||
CREATE USER 'root'@'localhost' IDENTIFIED BY 'local';
|
||||
GRANT ALL ON *.* TO 'root'@'%';
|
||||
CREATE USER 'sqlmonarcuser'@'%' IDENTIFIED BY 'sqlmonarcuser';
|
||||
GRANT ALL PRIVILEGES ON * . * TO 'sqlmonarcuser'@'%';
|
||||
FLUSH PRIVILEGES;
|
|
@ -0,0 +1,53 @@
|
|||
FROM php:7.4-fpm-alpine
|
||||
|
||||
# Set user to root
|
||||
USER root
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Install Additional dependencies
|
||||
RUN apk update && apk add --no-cache \
|
||||
build-base shadow vim curl zlib libzip-dev \
|
||||
libpng-dev libjpeg-turbo-dev libwebp-dev libxpm-dev zlib-dev \
|
||||
openssl-dev oniguruma-dev \
|
||||
icu-dev bzip2-dev freetype freetype-dev \
|
||||
php \
|
||||
php-cli \
|
||||
php-gd \
|
||||
php-pdo \
|
||||
php-pdo_mysql \
|
||||
php-mysqli \
|
||||
php-curl \
|
||||
php-intl \
|
||||
php-json \
|
||||
php-mbstring \
|
||||
php-pear \
|
||||
php-xml \
|
||||
php-phar \
|
||||
php-zip
|
||||
|
||||
RUN docker-php-source extract \
|
||||
pecl install xdebug-3.1.5
|
||||
|
||||
RUN apk add git
|
||||
RUN apk add --update nodejs npm
|
||||
|
||||
COPY php.ini /etc/php/7.4/php.ini
|
||||
COPY php-fpm-pool.conf /etc/php/7.4/pool.d/www.conf
|
||||
|
||||
RUN mkdir -p docker/php/conf.d
|
||||
COPY xdebug.ini docker/php/conf.d/xdebug.ini
|
||||
COPY error_reporting.ini docker/php/conf.d/error_reporting.ini
|
||||
|
||||
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \
|
||||
mv composer.phar /usr/local/bin/composer
|
||||
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /home/www/monarc
|
||||
|
||||
# RUN ["chmod", "+x", ".docker/php/install-app.sh"]
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
|
@ -0,0 +1,2 @@
|
|||
error_reporting=E_ALL
|
||||
display_errors=1
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
if [ ! -d "../../module" ]; then
|
||||
mkdir -p ../../module/Monarc
|
||||
cd ../../module/Monarc
|
||||
ln -sfn ./../../../../vendor/monarc/core Core
|
||||
ln -sfn ./../../../../vendor/monarc/frontoffice FrontOffice
|
||||
cd .
|
||||
fi
|
||||
|
||||
if [ ! -d "../../node_modules" ]; then
|
||||
mkdir -p ../../node_modules
|
||||
cd ../../node_modules
|
||||
git clone --config core.fileMode=false https://github.com/monarc-project/ng-client.git ng_client
|
||||
git clone --config core.fileMode=false https://github.com/monarc-project/ng-anr.git ng_anr
|
||||
cd ng_client
|
||||
npm ci
|
||||
cd .
|
||||
fi
|
||||
|
||||
if [ ! -f "../../config/autoload/local.php" ]; then
|
||||
cp ./local.php ../../config/autoload/
|
||||
fi
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
$appdir = getenv('APP_DIR') ?: '/home/vagrant/monarc';
|
||||
$string = file_get_contents($appdir.'/package.json');
|
||||
if (!$string) {
|
||||
$string = file_get_contents('./package.json');
|
||||
}
|
||||
$package_json = json_decode($string, true);
|
||||
|
||||
return [
|
||||
'doctrine' => [
|
||||
'connection' => [
|
||||
'orm_default' => [
|
||||
'params' => [
|
||||
'host' => 'monarc_mariadb',
|
||||
'user' => 'sqlmonarcuser',
|
||||
'password' => 'sqlmonarcuser',
|
||||
'dbname' => 'monarc_common',
|
||||
],
|
||||
],
|
||||
'orm_cli' => [
|
||||
'params' => [
|
||||
'host' => 'monarc_mariadb',
|
||||
'user' => 'sqlmonarcuser',
|
||||
'password' => 'sqlmonarcuser',
|
||||
'dbname' => 'monarc_cli',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'activeLanguages' => array('fr','en','de','nl','es','ro','it','ja','pl','pt','ru','zh'),
|
||||
|
||||
'appVersion' => $package_json['version'],
|
||||
|
||||
'checkVersion' => false,
|
||||
'appCheckingURL' => 'https://version.monarc.lu/check/MONARC',
|
||||
|
||||
'email' => [
|
||||
'name' => 'MONARC',
|
||||
'from' => 'info@monarc.lu',
|
||||
],
|
||||
|
||||
'mospApiUrl' => 'https://objects.monarc.lu/api/',
|
||||
|
||||
'monarc' => [
|
||||
'ttl' => 60, // timeout
|
||||
'salt' => '', // private salt for password encryption
|
||||
],
|
||||
|
||||
'statsApi' => [
|
||||
'baseUrl' => '',
|
||||
'apiKey' => '',
|
||||
],
|
||||
];
|
|
@ -0,0 +1,53 @@
|
|||
; Start a new pool named 'www'.
|
||||
; the variable $pool can we used in any directive and will be replaced by the
|
||||
; pool name ('www' here)
|
||||
[www]
|
||||
|
||||
; Unix user/group of processes
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
; The address on which to accept FastCGI requests.
|
||||
listen = 0.0.0.0:9000
|
||||
|
||||
; Set listen(2) backlog.
|
||||
listen.backlog = 1023
|
||||
|
||||
; Choose how the process manager will control the number of child processes.
|
||||
pm = dynamic
|
||||
|
||||
; The number of child processes to be created when pm is set to 'static' and the
|
||||
pm.max_children = 8
|
||||
|
||||
; The number of child processes created on startup.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||
pm.start_servers = 2
|
||||
|
||||
; The desired minimum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.min_spare_servers = 1
|
||||
|
||||
; The desired maximum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
pm.status_path = /php-fpm-status
|
||||
ping.path = /php-fpm-ping
|
||||
|
||||
; The timeout for serving a single request after which the worker process will be killed.
|
||||
request_terminate_timeout = 5m
|
||||
|
||||
; Chdir to this directory at the start.
|
||||
; Note: relative path can be used.
|
||||
; Default Value: current directory or / when chroot
|
||||
chdir = /
|
||||
|
||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
||||
; Note: on highloaded environement, this can cause some delay in the page
|
||||
; process time (several ms).
|
||||
; Default Value: no
|
||||
catch_workers_output = yes
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,9 @@
|
|||
zend_extension=xdebug
|
||||
|
||||
[xdebug]
|
||||
xdebug.mode=develop,debug
|
||||
xdebug.client_host=monarc.local
|
||||
xdebug.start_with_request=yes
|
||||
|
||||
#xdebug.remote_enable=1
|
||||
#xdebug.remote_connect_back=1
|
|
@ -0,0 +1,47 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
apache:
|
||||
build: .docker/apache
|
||||
container_name: monarc_apache
|
||||
ports:
|
||||
- 8080:80
|
||||
volumes:
|
||||
- .docker/apache/sites-enabled:/etc/apache2/sites-enabled
|
||||
- .:/home/www/monarc
|
||||
depends_on:
|
||||
- php
|
||||
|
||||
mariadb:
|
||||
image: mariadb
|
||||
restart: always
|
||||
container_name: monarc_mariadb
|
||||
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
volumes:
|
||||
- .docker/mariaDb/data/db:/var/lib/mysql
|
||||
- .docker/mariaDb/init:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- 3312:3306
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: root
|
||||
MARIADB_USER: sqlmonarcuser
|
||||
MARIADB_PASSWORD: sqlmonarcuser
|
||||
|
||||
php:
|
||||
build: .docker/php
|
||||
container_name: monarc_php
|
||||
volumes:
|
||||
- .:/home/www/monarc
|
||||
# TODO: make it work -> command: sh -c "./.docker/php/install-app.sh && ./scripts/update-all.sh"
|
||||
environment:
|
||||
- maildev_host=monarc_maildev
|
||||
depends_on:
|
||||
- maildev
|
||||
- mariadb
|
||||
|
||||
maildev:
|
||||
image: djfarrelly/maildev
|
||||
container_name: monarc_maildev
|
||||
ports:
|
||||
- 8001:80
|
|
@ -302,7 +302,7 @@ cat > config/autoload/local.php <<EOF
|
|||
<?php
|
||||
\$appdir = getenv('APP_DIR') ? getenv('APP_DIR') : '$PATH_TO_MONARC';
|
||||
\$string = file_get_contents(\$appdir.'/package.json');
|
||||
if(\$string === FALSE) {
|
||||
if (\$string === false) {
|
||||
\$string = file_get_contents('./package.json');
|
||||
}
|
||||
\$package_json = json_decode(\$string, true);
|
||||
|
|
Loading…
Reference in New Issue