This commit is contained in:
Matteo Gheza 2020-05-31 23:56:38 +02:00
parent cfd8e047fb
commit 350352fefd
4 changed files with 75 additions and 31 deletions

View File

@ -1,18 +1,19 @@
FROM trafex/alpine-nginx-php7:latest AS webserver FROM trafex/alpine-nginx-php7:latest AS webserver
LABEL maintainer="matteo@matteogheza.it" LABEL maintainer="matteo@matteogheza.it"
LABEL version="1.2" LABEL version="1.0"
LABEL description="Docker project for open source firefighter management software" LABEL description="Docker project for open source firefighter management software"
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./server /var/www/html COPY ./server /var/www/html
# Install composer from the official image
COPY --from=composer /usr/bin/composer /usr/bin/composer COPY --from=composer /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html WORKDIR /var/www/html
USER root USER root
RUN apk add --no-cache bash sed php-pdo php-pdo_mysql php-pdo_sqlite php-pdo_pgsql RUN apk add --no-cache bash sed php-pdo php-pdo_mysql php-pdo_sqlite php-pdo_pgsql git
RUN composer install --optimize-autoloader --no-interaction --no-progress RUN composer install --no-dev --optimize-autoloader --no-interaction --no-progress
#RUN echo "@reboot cd /var/www/html/install && php install.php config" > /etc/crontabs/root
USER nobody USER nobody
EXPOSE 8080 EXPOSE 8080

View File

@ -1,29 +1,30 @@
version: '3.3' version: '3.3'
services: services:
db: db:
image: mariadb:latest image: mariadb:latest
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: allerta-db MYSQL_USER: allerta
MYSQL_USER: allerta MYSQL_PASSWORD: password
MYSQL_PASSWORD: password MYSQL_DATABASE: allerta-db
allerta:
allerta: depends_on:
depends_on: - db
- db links:
image: allertavvf/allertavvf - db:db
build: ./ image: allertavvf/allertavvf
ports: build: ./
- "8081:8080" ports:
restart: always - "8081:8080"
environment: restart: always
ALLERTA_DB_HOST: db:3306 environment:
ALLERTA_DB_USER: allerta DB_HOST: db
ALLERTA_DB_PASSWORD: password DB_USERNAME: root
ALLERTA_DB_NAME: allerta-db DB_PASSWORD: root
DB_NAME: allerta-db
volumes: volumes:
db_data: {} db_data: {}

View File

@ -393,7 +393,7 @@ INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_ti
} }
function validate_arg($options, $name, $default){ function validate_arg($options, $name, $default){
return array_key_exists($name, $options) ? $options[$name] : (isset($_ENV[$name]) ? $_ENV[$name] : (isset($_ENV[strtoupper($name)]) ? $_ENV[strtoupper($name)] : $default)); return array_key_exists($name, $options) ? $options[$name] : (getenv($name)!==false ? getenv($name) : (getenv(strtoupper($name))!==false ? getenv(strtoupper($name)) : $default));
} }
function change_dir($directory){ function change_dir($directory){

42
supervisord.conf Normal file
View File

@ -0,0 +1,42 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[program:php-fpm]
command=php-fpm7 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:crond]
command=crond -f
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:configurator]
command=sh -c "sleep 3;php install.php config"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
directory=/var/www/html/install