first commit
This commit is contained in:
commit
296216444a
22
000-default.conf
Normal file
22
000-default.conf
Normal file
@ -0,0 +1,22 @@
|
||||
<VirtualHost *:8001>
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /opt/kimai/public
|
||||
|
||||
PassEnv DATABASE_PREFIX
|
||||
PassEnv MAILER_FROM
|
||||
PassEnv APP_ENV
|
||||
PassEnv APP_SECRET
|
||||
PassEnv DATABASE_URL
|
||||
PassEnv MAILER_URL
|
||||
PassEnv TRUSTED_PROXIES
|
||||
PassEnv TRUSTED_HOSTS
|
||||
|
||||
<Directory "/opt/kimai/public">
|
||||
Require all granted
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
ServerName localhost
|
||||
246
Dockerfile
Normal file
246
Dockerfile
Normal file
@ -0,0 +1,246 @@
|
||||
# _ ___ _ ____
|
||||
# | |/ (_)_ __ ___ __ _(_)___ \
|
||||
# | ' /| | '_ ` _ \ / _` | | __) |
|
||||
# | . \| | | | | | | (_| | |/ __/
|
||||
# |_|\_\_|_| |_| |_|\__,_|_|_____|
|
||||
#
|
||||
|
||||
# Source base [fpm-alpine/apache-debian]
|
||||
ARG BASE="fpm-alpine"
|
||||
|
||||
###########################
|
||||
# Shared tools
|
||||
###########################
|
||||
|
||||
# full kimai source
|
||||
FROM alpine:3.11 AS git-dev
|
||||
ARG KIMAI="1.8"
|
||||
RUN apk add --no-cache git && \
|
||||
git clone --depth 1 --branch ${KIMAI} https://github.com/kevinpapst/kimai2.git /opt/kimai
|
||||
|
||||
# production kimai source
|
||||
FROM git-dev AS git-prod
|
||||
WORKDIR /opt/kimai
|
||||
RUN rm -r tests
|
||||
|
||||
# composer with prestissimo (faster deps install)
|
||||
FROM composer:1.9 AS composer
|
||||
RUN mkdir /opt/kimai && \
|
||||
composer require --working-dir=/opt/kimai hirak/prestissimo
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# PHP extensions
|
||||
###########################
|
||||
|
||||
#fpm alpine php extension base
|
||||
FROM php:7.4.4-fpm-alpine3.11 AS fpm-alpine-php-ext-base
|
||||
RUN apk add --no-cache \
|
||||
# build-tools
|
||||
autoconf \
|
||||
dpkg \
|
||||
dpkg-dev \
|
||||
file \
|
||||
g++ \
|
||||
gcc \
|
||||
libatomic \
|
||||
libc-dev \
|
||||
libgomp \
|
||||
libmagic \
|
||||
m4 \
|
||||
make \
|
||||
mpc1 \
|
||||
mpfr4 \
|
||||
musl-dev \
|
||||
perl \
|
||||
re2c \
|
||||
# gd
|
||||
freetype-dev \
|
||||
libpng-dev \
|
||||
# icu
|
||||
icu-dev \
|
||||
# ldap
|
||||
openldap-dev \
|
||||
libldap \
|
||||
# zip
|
||||
libzip-dev \
|
||||
# xsl
|
||||
libxslt-dev
|
||||
|
||||
|
||||
# apache debian php extension base
|
||||
FROM php:7.4.4-apache-buster AS apache-debian-php-ext-base
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
libldap2-dev \
|
||||
libicu-dev \
|
||||
libpng-dev \
|
||||
libzip-dev \
|
||||
libxslt1-dev \
|
||||
libfreetype6-dev
|
||||
|
||||
|
||||
# php extension gd - 13.86s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-gd
|
||||
RUN docker-php-ext-configure gd \
|
||||
--with-freetype && \
|
||||
docker-php-ext-install -j$(nproc) gd
|
||||
|
||||
# php extension intl : 15.26s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-intl
|
||||
RUN docker-php-ext-install -j$(nproc) intl
|
||||
|
||||
# php extension ldap : 8.45s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-ldap
|
||||
RUN docker-php-ext-configure ldap && \
|
||||
docker-php-ext-install -j$(nproc) ldap
|
||||
|
||||
# php extension pdo_mysql : 6.14s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-pdo_mysql
|
||||
RUN docker-php-ext-install -j$(nproc) pdo_mysql
|
||||
|
||||
# php extension zip : 8.18s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-zip
|
||||
RUN docker-php-ext-install -j$(nproc) zip
|
||||
|
||||
# php extension xsl : ?.?? s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-xsl
|
||||
RUN docker-php-ext-install -j$(nproc) xsl
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# fpm-alpine base build
|
||||
###########################
|
||||
|
||||
# fpm-alpine base build
|
||||
FROM php:7.4.4-fpm-alpine3.11 AS fpm-alpine-base
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
freetype \
|
||||
haveged \
|
||||
icu \
|
||||
libldap \
|
||||
libpng \
|
||||
libzip \
|
||||
libxslt-dev && \
|
||||
touch /use_fpm
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# apache-debian base build
|
||||
###########################
|
||||
|
||||
FROM php:7.4.4-apache-buster AS apache-debian-base
|
||||
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
bash \
|
||||
haveged \
|
||||
libicu63 \
|
||||
libpng16-16 \
|
||||
libzip4 \
|
||||
libxslt1.1 \
|
||||
libfreetype6 && \
|
||||
echo "Listen 8001" > /etc/apache2/ports.conf && \
|
||||
a2enmod rewrite && \
|
||||
touch /use_apache
|
||||
|
||||
EXPOSE 8001
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# global base build
|
||||
###########################
|
||||
|
||||
FROM ${BASE}-base AS base
|
||||
LABEL maintainer="tobias@neontribe.co.uk"
|
||||
LABEL maintainer="bastian@schroll-software.de"
|
||||
|
||||
ARG KIMAI="1.8"
|
||||
ENV KIMAI=${KIMAI}
|
||||
|
||||
ARG TZ=Europe/Berlin
|
||||
ENV TZ=${TZ}
|
||||
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone && \
|
||||
# make composer home dir
|
||||
mkdir /composer && \
|
||||
chown -R www-data:www-data /composer
|
||||
|
||||
# copy startup script
|
||||
COPY startup.sh /startup.sh
|
||||
|
||||
# copy composer
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
COPY --from=composer --chown=www-data:www-data /opt/kimai/vendor /opt/kimai/vendor
|
||||
|
||||
# copy php extensions
|
||||
|
||||
# PHP extension xsl
|
||||
COPY --from=php-ext-xsl /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini
|
||||
COPY --from=php-ext-xsl /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xsl.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xsl.so
|
||||
# PHP extension pdo_mysql
|
||||
COPY --from=php-ext-pdo_mysql /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
|
||||
COPY --from=php-ext-pdo_mysql /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so
|
||||
# PHP extension zip
|
||||
COPY --from=php-ext-zip /usr/local/etc/php/conf.d/docker-php-ext-zip.ini /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
|
||||
COPY --from=php-ext-zip /usr/local/lib/php/extensions/no-debug-non-zts-20190902/zip.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/zip.so
|
||||
# PHP extension ldap
|
||||
COPY --from=php-ext-ldap /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini
|
||||
COPY --from=php-ext-ldap /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ldap.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ldap.so
|
||||
# PHP extension gd
|
||||
COPY --from=php-ext-gd /usr/local/etc/php/conf.d/docker-php-ext-gd.ini /usr/local/etc/php/conf.d/docker-php-ext-gd.ini
|
||||
COPY --from=php-ext-gd /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd.so
|
||||
# PHP extension intl
|
||||
COPY --from=php-ext-intl /usr/local/etc/php/conf.d/docker-php-ext-intl.ini /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
|
||||
COPY --from=php-ext-intl /usr/local/lib/php/extensions/no-debug-non-zts-20190902/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/intl.so
|
||||
|
||||
ENV DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
|
||||
ENV APP_SECRET=change_this_to_something_unique
|
||||
# The default container name for nginx is nginx
|
||||
ENV TRUSTED_PROXIES=nginx-proxy,localhost,127.0.0.1
|
||||
ENV TRUSTED_HOSTS=nginx-proxy,localhost,127.0.0.1
|
||||
ENV MAILER_FROM=kimai@example.com
|
||||
ENV MAILER_URL=null://localhost
|
||||
ENV ADMINPASS=
|
||||
ENV ADMINMAIL=
|
||||
|
||||
VOLUME [ "/opt/kimai/var" ]
|
||||
|
||||
ENTRYPOINT /startup.sh
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# final builds
|
||||
###########################
|
||||
|
||||
# developement build
|
||||
FROM base AS dev
|
||||
# copy kimai develop source
|
||||
COPY --from=git-dev --chown=www-data:www-data /opt/kimai /opt/kimai
|
||||
# do the composer deps installation
|
||||
RUN export COMPOSER_HOME=/composer && \
|
||||
composer install --working-dir=/opt/kimai --optimize-autoloader && \
|
||||
composer clearcache && \
|
||||
composer require --working-dir=/opt/kimai laminas/laminas-ldap && \
|
||||
chown -R www-data:www-data /opt/kimai && \
|
||||
sed "s/128M/256M/g" /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini
|
||||
USER www-data
|
||||
|
||||
# production build
|
||||
FROM base AS prod
|
||||
# copy kimai production source
|
||||
COPY --from=git-prod --chown=www-data:www-data /opt/kimai /opt/kimai
|
||||
# do the composer deps installation
|
||||
RUN export COMPOSER_HOME=/composer && \
|
||||
composer install --working-dir=/opt/kimai --no-dev --optimize-autoloader && \
|
||||
composer clearcache && \
|
||||
composer require --working-dir=/opt/kimai laminas/laminas-ldap && \
|
||||
chown -R www-data:www-data /opt/kimai
|
||||
USER www-data
|
||||
246
Dockerfile.good
Normal file
246
Dockerfile.good
Normal file
@ -0,0 +1,246 @@
|
||||
# _ ___ _ ____
|
||||
# | |/ (_)_ __ ___ __ _(_)___ \
|
||||
# | ' /| | '_ ` _ \ / _` | | __) |
|
||||
# | . \| | | | | | | (_| | |/ __/
|
||||
# |_|\_\_|_| |_| |_|\__,_|_|_____|
|
||||
#
|
||||
|
||||
# Source base [fpm-alpine/apache-debian]
|
||||
ARG BASE="fpm-alpine"
|
||||
|
||||
###########################
|
||||
# Shared tools
|
||||
###########################
|
||||
|
||||
# full kimai source
|
||||
FROM alpine:3.11 AS git-dev
|
||||
ARG KIMAI="1.8"
|
||||
RUN apk add --no-cache git && \
|
||||
git clone --depth 1 --branch ${KIMAI} https://github.com/kevinpapst/kimai2.git /opt/kimai
|
||||
|
||||
# production kimai source
|
||||
FROM git-dev AS git-prod
|
||||
WORKDIR /opt/kimai
|
||||
RUN rm -r tests
|
||||
|
||||
# composer with prestissimo (faster deps install)
|
||||
FROM composer:1.9 AS composer
|
||||
RUN mkdir /opt/kimai && \
|
||||
composer require --working-dir=/opt/kimai hirak/prestissimo
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# PHP extensions
|
||||
###########################
|
||||
|
||||
#fpm alpine php extension base
|
||||
FROM php:7.4.4-fpm-alpine3.11 AS fpm-alpine-php-ext-base
|
||||
RUN apk add --no-cache \
|
||||
# build-tools
|
||||
autoconf \
|
||||
dpkg \
|
||||
dpkg-dev \
|
||||
file \
|
||||
g++ \
|
||||
gcc \
|
||||
libatomic \
|
||||
libc-dev \
|
||||
libgomp \
|
||||
libmagic \
|
||||
m4 \
|
||||
make \
|
||||
mpc1 \
|
||||
mpfr4 \
|
||||
musl-dev \
|
||||
perl \
|
||||
re2c \
|
||||
# gd
|
||||
freetype-dev \
|
||||
libpng-dev \
|
||||
# icu
|
||||
icu-dev \
|
||||
# ldap
|
||||
openldap-dev \
|
||||
libldap \
|
||||
# zip
|
||||
libzip-dev \
|
||||
# xsl
|
||||
libxslt-dev
|
||||
|
||||
|
||||
# apache debian php extension base
|
||||
FROM php:7.4.4-apache-buster AS apache-debian-php-ext-base
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
libldap2-dev \
|
||||
libicu-dev \
|
||||
libpng-dev \
|
||||
libzip-dev \
|
||||
libxslt1-dev \
|
||||
libfreetype6-dev
|
||||
|
||||
|
||||
# php extension gd - 13.86s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-gd
|
||||
RUN docker-php-ext-configure gd \
|
||||
--with-freetype && \
|
||||
docker-php-ext-install -j$(nproc) gd
|
||||
|
||||
# php extension intl : 15.26s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-intl
|
||||
RUN docker-php-ext-install -j$(nproc) intl
|
||||
|
||||
# php extension ldap : 8.45s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-ldap
|
||||
RUN docker-php-ext-configure ldap && \
|
||||
docker-php-ext-install -j$(nproc) ldap
|
||||
|
||||
# php extension pdo_mysql : 6.14s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-pdo_mysql
|
||||
RUN docker-php-ext-install -j$(nproc) pdo_mysql
|
||||
|
||||
# php extension zip : 8.18s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-zip
|
||||
RUN docker-php-ext-install -j$(nproc) zip
|
||||
|
||||
# php extension xsl : ?.?? s
|
||||
FROM ${BASE}-php-ext-base AS php-ext-xsl
|
||||
RUN docker-php-ext-install -j$(nproc) xsl
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# fpm-alpine base build
|
||||
###########################
|
||||
|
||||
# fpm-alpine base build
|
||||
FROM php:7.4.4-fpm-alpine3.11 AS fpm-alpine-base
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
freetype \
|
||||
haveged \
|
||||
icu \
|
||||
libldap \
|
||||
libpng \
|
||||
libzip \
|
||||
libxslt-dev && \
|
||||
touch /use_fpm
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# apache-debian base build
|
||||
###########################
|
||||
|
||||
FROM php:7.4.4-apache-buster AS apache-debian-base
|
||||
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
bash \
|
||||
haveged \
|
||||
libicu63 \
|
||||
libpng16-16 \
|
||||
libzip4 \
|
||||
libxslt1.1 \
|
||||
libfreetype6 && \
|
||||
echo "Listen 8001" > /etc/apache2/ports.conf && \
|
||||
a2enmod rewrite && \
|
||||
touch /use_apache
|
||||
|
||||
EXPOSE 8001
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# global base build
|
||||
###########################
|
||||
|
||||
FROM ${BASE}-base AS base
|
||||
LABEL maintainer="tobias@neontribe.co.uk"
|
||||
LABEL maintainer="bastian@schroll-software.de"
|
||||
|
||||
ARG KIMAI="1.8"
|
||||
ENV KIMAI=${KIMAI}
|
||||
|
||||
ARG TZ=Europe/Berlin
|
||||
ENV TZ=${TZ}
|
||||
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone && \
|
||||
# make composer home dir
|
||||
mkdir /composer && \
|
||||
chown -R www-data:www-data /composer
|
||||
|
||||
# copy startup script
|
||||
COPY startup.sh /startup.sh
|
||||
|
||||
# copy composer
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
COPY --from=composer --chown=www-data:www-data /opt/kimai/vendor /opt/kimai/vendor
|
||||
|
||||
# copy php extensions
|
||||
|
||||
# PHP extension xsl
|
||||
COPY --from=php-ext-xsl /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini
|
||||
COPY --from=php-ext-xsl /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xsl.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xsl.so
|
||||
# PHP extension pdo_mysql
|
||||
COPY --from=php-ext-pdo_mysql /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
|
||||
COPY --from=php-ext-pdo_mysql /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/pdo_mysql.so
|
||||
# PHP extension zip
|
||||
COPY --from=php-ext-zip /usr/local/etc/php/conf.d/docker-php-ext-zip.ini /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
|
||||
COPY --from=php-ext-zip /usr/local/lib/php/extensions/no-debug-non-zts-20190902/zip.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/zip.so
|
||||
# PHP extension ldap
|
||||
COPY --from=php-ext-ldap /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini
|
||||
COPY --from=php-ext-ldap /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ldap.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ldap.so
|
||||
# PHP extension gd
|
||||
COPY --from=php-ext-gd /usr/local/etc/php/conf.d/docker-php-ext-gd.ini /usr/local/etc/php/conf.d/docker-php-ext-gd.ini
|
||||
COPY --from=php-ext-gd /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/gd.so
|
||||
# PHP extension intl
|
||||
COPY --from=php-ext-intl /usr/local/etc/php/conf.d/docker-php-ext-intl.ini /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
|
||||
COPY --from=php-ext-intl /usr/local/lib/php/extensions/no-debug-non-zts-20190902/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/intl.so
|
||||
|
||||
ENV DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
|
||||
ENV APP_SECRET=change_this_to_something_unique
|
||||
# The default container name for nginx is nginx
|
||||
ENV TRUSTED_PROXIES=nginx,localhost,127.0.0.1
|
||||
ENV TRUSTED_HOSTS=nginx,localhost,127.0.0.1
|
||||
ENV MAILER_FROM=kimai@example.com
|
||||
ENV MAILER_URL=null://localhost
|
||||
ENV ADMINPASS=
|
||||
ENV ADMINMAIL=
|
||||
|
||||
VOLUME [ "/opt/kimai/var" ]
|
||||
|
||||
ENTRYPOINT /startup.sh
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
# final builds
|
||||
###########################
|
||||
|
||||
# developement build
|
||||
FROM base AS dev
|
||||
# copy kimai develop source
|
||||
COPY --from=git-dev --chown=www-data:www-data /opt/kimai /opt/kimai
|
||||
# do the composer deps installation
|
||||
RUN export COMPOSER_HOME=/composer && \
|
||||
composer install --working-dir=/opt/kimai --optimize-autoloader && \
|
||||
composer clearcache && \
|
||||
composer require --working-dir=/opt/kimai laminas/laminas-ldap && \
|
||||
chown -R www-data:www-data /opt/kimai && \
|
||||
sed "s/128M/256M/g" /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini
|
||||
USER www-data
|
||||
|
||||
# production build
|
||||
FROM base AS prod
|
||||
# copy kimai production source
|
||||
COPY --from=git-prod --chown=www-data:www-data /opt/kimai /opt/kimai
|
||||
# do the composer deps installation
|
||||
RUN export COMPOSER_HOME=/composer && \
|
||||
composer install --working-dir=/opt/kimai --no-dev --optimize-autoloader && \
|
||||
composer clearcache && \
|
||||
composer require --working-dir=/opt/kimai laminas/laminas-ldap && \
|
||||
chown -R www-data:www-data /opt/kimai
|
||||
USER www-data
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Toby Batch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
147
README.md
Normal file
147
README.md
Normal file
@ -0,0 +1,147 @@
|
||||
# Kimai Dockers
|
||||
|
||||
We provide a set of docker images for the [Kimai v2](https://github.com/kevinpapst/kimai2) project.
|
||||
|
||||
## Upgrading
|
||||
|
||||
The newer kimai instances cache images in the var directory (/opt/kimai/var).
|
||||
This folder will need to be preserved and mounted into newer builds.
|
||||
The docker compose file below will handle that but if you didn't save those file you will need to do that manually.
|
||||
|
||||
## Quick start
|
||||
|
||||
### Evaluate
|
||||
|
||||
Run a throw away instance of kimai for evaluation or testing.
|
||||
This is built against the master branch of the kevinpapst/kimai2 project and runs against a sqlite database inside the container using the built in php server.
|
||||
When stopped all trace of the docker will disappear.
|
||||
If you run the lines below you can hit kimai at `http://localhost:8001` and log in with `admin` / `changemeplease`
|
||||
The test users listed in [the develop section](https://www.kimai.org/documentation/installation.html) also exist.
|
||||
|
||||
```bash
|
||||
docker run --rm -ti -p 8001:8001 --name kimai2 kimai/kimai2:apache-debian-1.8-dev
|
||||
docker exec kimai2 rm /opt/kimai/var/data/kimai.sqlite
|
||||
docker exec kimai2 /opt/kimai/bin/console kimai:reset-dev
|
||||
docker exec kimai2 /opt/kimai/bin/console kimai:create-user admin admin@example.com ROLE_SUPER_ADMIN changemeplease
|
||||
```
|
||||
|
||||
### Production
|
||||
|
||||
Run a production kimai with persistent database in a seperate mysql container.
|
||||
The best way of doing this is with a docker compose file.
|
||||
You can hit kimai at `http://localhost:8001` and log in with `superadmin` / `changemeplease`.
|
||||
|
||||
```yaml
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
sqldb:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
- MYSQL_DATABASE=kimai
|
||||
- MYSQL_USER=kimaiuser
|
||||
- MYSQL_PASSWORD=kimaipassword
|
||||
- MYSQL_ROOT_PASSWORD=changemeplease
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
command: --default-storage-engine innodb
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: mysqladmin -pchangemeplease ping -h localhost
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
nginx:
|
||||
build: compose
|
||||
ports:
|
||||
- 8001:80
|
||||
volumes:
|
||||
- ./nginx_site.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- public:/opt/kimai/public:ro
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- kimai
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx/health || exit 1
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:fpm-alpine-1.8-prod
|
||||
environment:
|
||||
- APP_ENV=prod
|
||||
- TRUSTED_HOSTS=localhost
|
||||
- ADMINMAIL=admin@kimai.local
|
||||
- ADMINPASS=changemeplease
|
||||
volumes:
|
||||
- public:/opt/kimai/public
|
||||
- var:/opt/kimai/var
|
||||
# - ./ldap.conf:/etc/openldap/ldap.conf:z
|
||||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx || exit 1
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
postfix:
|
||||
image: catatnight/postfix:latest
|
||||
environment:
|
||||
maildomain: kimai.local
|
||||
smtp_user: kimai:kimai
|
||||
restart: unless-stopped
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
var:
|
||||
public:
|
||||
```
|
||||
|
||||
## Permissions
|
||||
|
||||
If you are mounting the code base into the container (`-v $PWD/kimai:/opt/kimai`) then you will need to fix the permissions on the var folder.
|
||||
|
||||
```bash
|
||||
docker exec --user root CONTAINER_NAME chown -R www-data:www-data /opt/kimai/var
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
docker-compose --user root exec CONTAINER_NAME chown -R www-data:www-data /opt/kimai/var
|
||||
```
|
||||
|
||||
## Runtime Arguments
|
||||
|
||||
The following settings can set at runtime:
|
||||
|
||||
Kimai/symfony core settings, see the symfony and kimai docs for more info on these.
|
||||
|
||||
```bash
|
||||
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
|
||||
APP_SECRET=change_this_to_something_unique
|
||||
TRUSTED_PROXIES=nginx,localhost,127.0.0.1
|
||||
TRUSTED_HOSTS=nginx,localhost,127.0.0.1
|
||||
MAILER_FROM=kimai@example.com
|
||||
MAILER_URL=null://localhost
|
||||
```
|
||||
|
||||
Start up values:
|
||||
|
||||
If set then these values will try and create a new admin user.
|
||||
|
||||
```bash
|
||||
ADMINPASS=
|
||||
ADMINMAIL=
|
||||
```
|
||||
|
||||
## NGINX and proxying
|
||||
|
||||
While outside the direct responsibility of this project we get a lot of issues reported that relate to proxying with NGINX into the FPM container.
|
||||
Note that you will need to set the name of your NGINX container to be in the list of TRUSTED_HOSTS when you start the kimai container.
|
||||
1
ROOT-CA.pem
Normal file
1
ROOT-CA.pem
Normal file
@ -0,0 +1 @@
|
||||
# Add your Root CA here
|
||||
48
bin/build.sh
Executable file
48
bin/build.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo
|
||||
echo "VERSIONS is a space delimited list of branches and or tags."
|
||||
echo "e.g. 1.7 fixes/foo"
|
||||
echo
|
||||
echo " -b The images bases, e.g. apache-debian fpm-alpine"
|
||||
echo " -t The timezone, e.g. Europe/London"
|
||||
echo " -s The stages, e.g. dev prod"
|
||||
echo " -k Do not use Docker Build Kit"
|
||||
echo " -c Use the docker cache, default behaviour is to add --nocache"
|
||||
echo " -h Show help"
|
||||
}
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
export TZ=Europe/London
|
||||
export STAGES="dev prod"
|
||||
export BASES="apache-debian fpm-alpine"
|
||||
NOCACHE="--no-cache"
|
||||
|
||||
USAGE="$0 [-t TIMEZONE] [-b BASES] [-s STAGES] [-k] [-c] [-h] VERSIONS"
|
||||
|
||||
while getopts "b:t:s:kch" options; do
|
||||
case $options in
|
||||
b) export BASES="$OPTARG";;
|
||||
s) export STAGES="$OPTARG";;
|
||||
t) export TZ="$OPTARG";;
|
||||
k) unset DOCKER_BUILDKIT;;
|
||||
c) unset NOCACHE;;
|
||||
h) echo $USAGE; usage; exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
export KIMAIS=$@
|
||||
|
||||
if [ ! -z "$1" ] && [ -z "$KIMAIS" ]; then
|
||||
KIMAIS=$@
|
||||
fi
|
||||
|
||||
for KIMAI in $KIMAIS; do
|
||||
for STAGE_NAME in $STAGES; do
|
||||
for BASE in $BASES; do
|
||||
docker build $NOCACHE -t kimai/kimai2:${BASE}-${KIMAI}-${STAGE_NAME} --build-arg KIMAI=${KIMAI} --build-arg BASE=${BASE} --build-arg TZ=${TZ} --target=${STAGE_NAME} $(dirname $0)/..
|
||||
done
|
||||
done
|
||||
done
|
||||
16
bin/push.sh
Executable file
16
bin/push.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -z "$1" ] && [ -z "$KIMAIS" ]; then
|
||||
KIMAIS=$@
|
||||
fi
|
||||
|
||||
for KIMAI in $KIMAIS; do
|
||||
docker push kimai/kimai2:apache-debian-$KIMAI-dev
|
||||
docker push kimai/kimai2:fpm-alpine-$KIMAI-dev
|
||||
docker push kimai/kimai2:apache-debian-$KIMAI-prod
|
||||
docker push kimai/kimai2:fpm-alpine-$KIMAI-prod
|
||||
docker push kimai/kimai2:apache-debian-master-dev
|
||||
docker push kimai/kimai2:fpm-alpine-master-dev
|
||||
docker push kimai/kimai2:apache-debian-master-prod
|
||||
docker push kimai/kimai2:fpm-alpine-master-prod
|
||||
done
|
||||
128
bin/simple-test.sh
Executable file
128
bin/simple-test.sh
Executable file
@ -0,0 +1,128 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASEDIR=$(realpath $(dirname $0)/..)
|
||||
COMPOSEDIR="$BASEDIR/compose"
|
||||
SLEEP_COUNT=6
|
||||
SLEEP_DURATION=5
|
||||
|
||||
ESC_SEQ="\x1b["
|
||||
COL_RESET=$ESC_SEQ"39;49;00m"
|
||||
COL_RED=$ESC_SEQ"31;01m"
|
||||
COL_GREEN=$ESC_SEQ"32;01m"
|
||||
TICK="\xE2\x9C\x94"
|
||||
|
||||
function main {
|
||||
cleanup all
|
||||
cleanup volumes
|
||||
|
||||
test_container http://localhost:8001 base apache.dev
|
||||
test_container http://localhost:8001 base apache.dev apache.prod
|
||||
test_container http://localhost:8001 base apache.dev mysql
|
||||
test_container http://localhost:8001 base apache.dev apache.prod mysql
|
||||
test_container http://localhost:8002 base fpm.dev nginx
|
||||
test_container http://localhost:8002 base fpm.prod nginx
|
||||
test_container http://localhost:8002 base fpm.dev nginx mysql
|
||||
test_container http://localhost:8002 base fpm.prod nginx mysql
|
||||
test_container http://localhost:8001 base apache.dev ldap
|
||||
test_container http://localhost:8002 base fpm.dev nginx ldap
|
||||
|
||||
finally
|
||||
}
|
||||
|
||||
function finally {
|
||||
cleanup all
|
||||
cleanup volumes
|
||||
exit $1
|
||||
}
|
||||
|
||||
function test_container {
|
||||
cleanup kimai
|
||||
|
||||
URL=$1
|
||||
cmd=$(make_cmd "${@:2}")
|
||||
echo -e ${COL_GREEN}${KIMAI} ${@:2}${COL_RESET} starting...
|
||||
echo $cmd
|
||||
$cmd 2>&1 > /dev/null
|
||||
STATUS=$(isready $URL)
|
||||
if [ "$STATUS" == "FAILED" ]; then
|
||||
echo -e ${COL_RED}Failed:${COL_RESET} $cmd
|
||||
finally 1
|
||||
fi
|
||||
# TODO add some function tests
|
||||
echo -e "\n${COL_GREEN}${TICK} Done.\n${COL_RESET}"
|
||||
}
|
||||
|
||||
function isready {
|
||||
count=0
|
||||
STATUS=$(check_command $1)
|
||||
until [ "$STATUS" == 200 ]; do
|
||||
>&2 echo -n $STATUS", "
|
||||
count=$(( count + 1 ))
|
||||
if [ $count -gt $SLEEP_COUNT ]; then
|
||||
echo FAILED
|
||||
return
|
||||
fi
|
||||
sleep $SLEEP_DURATION
|
||||
STATUS=$(check_command $1)
|
||||
done
|
||||
>&2 echo -n $STATUS
|
||||
echo $STATUS
|
||||
}
|
||||
|
||||
function check_command {
|
||||
echo $(curl -L -s -o /dev/null -w "%{http_code}" $1)
|
||||
}
|
||||
|
||||
function cleanup {
|
||||
if [ -z "$1" ]; then
|
||||
TAG=all
|
||||
else
|
||||
TAG=$1
|
||||
fi
|
||||
|
||||
case $TAG in
|
||||
all)
|
||||
_cleanup kimai_func_tests_;;
|
||||
postfix)
|
||||
_cleanup kimai_func_tests_postfix;;
|
||||
mysql)
|
||||
_cleanup kimai_func_tests_sqldb;;
|
||||
kimai)
|
||||
_cleanup kimai_func_tests_kimai;;
|
||||
volumes)
|
||||
for x in $(docker volume ls |grep kimai_func_tests_|awk '{print $1}'); do
|
||||
docker volume rm $x > /dev/null 2>&1
|
||||
done
|
||||
esac
|
||||
}
|
||||
|
||||
function _cleanup {
|
||||
if [ -z "$1" ]; then
|
||||
echo Cannot run $0 with a target.
|
||||
return
|
||||
fi
|
||||
|
||||
for x in $(docker ps -a |grep $1|awk '{print $1}'); do
|
||||
docker stop $x > /dev/null 2>&1
|
||||
docker rm $x > /dev/null 2>&1
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
function make_cmd {
|
||||
cmd="docker-compose -p kimai_func_tests --log-level CRITICAL "
|
||||
for x in $@; do
|
||||
cmd="$cmd -f $COMPOSEDIR/docker-compose.$x.yml"
|
||||
done
|
||||
cmd="$cmd up -d"
|
||||
echo $cmd
|
||||
}
|
||||
|
||||
if [ ! -z "$1" ] && [ -z "$KIMAIS" ]; then
|
||||
KIMAIS=$@
|
||||
fi
|
||||
|
||||
for KIMAI in $KIMAIS; do
|
||||
export KIMAI
|
||||
main
|
||||
done
|
||||
3
compose/Dockerfile
Normal file
3
compose/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
ADD nginx_site.conf /etc/nginx/conf.d/default.conf
|
||||
44
compose/README.md
Normal file
44
compose/README.md
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
## Reset and clean
|
||||
|
||||
docker-compose stop && docker-compose rm && docker volume prune
|
||||
|
||||
## Apache/Kimai dev/sqlite
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.apache.dev.yml up
|
||||
|
||||
## Apache/Kimai prod/sqlite
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.apache.prod.yml up
|
||||
|
||||
## Apache/Kimai dev/mysql
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.apache.dev.yml -f docker-compose.mysql.yml up
|
||||
|
||||
## Apache/Kimai prod/mysql
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.apache.prod.yml -f docker-compose.mysql.yml up
|
||||
|
||||
## FPM/Kimai dev/sqlite
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.fpm.dev.yml -f docker-compose.nginx.yml up
|
||||
|
||||
## FPM/Kimai prod/sqlite
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.fpm.prod.yml -f docker-compose.nginx.yml up
|
||||
|
||||
## FPM/Kimai dev/mysql
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.fpm.dev.yml -f docker-compose.nginx.yml -f docker-compose.mysql.yml up
|
||||
|
||||
## FPM/Kimai prod/mysql
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.fpm.prod.yml -f docker-compose.nginx.yml -f docker-compose.mysql.yml up
|
||||
|
||||
## Apache/Kimai dev/sqlite/LDAP
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.apache.dev.yml -f docker-compose.ldap.yml up
|
||||
|
||||
## FPM/Kimai dev/sqlite/LDAP
|
||||
|
||||
docker-compose -f docker-compose.base.yml -f docker-compose.fpm.dev.yml -f docker-compose.nginx.yml -f docker-compose.ldap.yml up
|
||||
5
compose/docker-compose.apache.dev.yml
Normal file
5
compose/docker-compose.apache.dev.yml
Normal file
@ -0,0 +1,5 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:apache-debian-$KIMAI-dev
|
||||
8
compose/docker-compose.apache.prod.yml
Normal file
8
compose/docker-compose.apache.prod.yml
Normal file
@ -0,0 +1,8 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
# Apache with sqlite, the dev/evaluate option
|
||||
kimai:
|
||||
image: kimai/kimai2:apache-debian-$KIMAI-prod
|
||||
environment:
|
||||
- APP_ENV=prod
|
||||
21
compose/docker-compose.base.yml
Normal file
21
compose/docker-compose.base.yml
Normal file
@ -0,0 +1,21 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
# Apache with sqlite, the dev/evaluate option
|
||||
kimai:
|
||||
environment:
|
||||
- APP_ENV=dev
|
||||
- TRUSTED_HOSTS=localhost
|
||||
- ADMINMAIL=admin@kimai.local
|
||||
- ADMINPASS=changemeplease
|
||||
volumes:
|
||||
- /opt/kimai/var
|
||||
ports:
|
||||
- 8001:8001
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: curl -s -o /dev/null http://localhost:8001 || exit 1
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
11
compose/docker-compose.fpm.dev.yml
Normal file
11
compose/docker-compose.fpm.dev.yml
Normal file
@ -0,0 +1,11 @@
|
||||
# example composer file for the fpm-alpine image
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:fpm-alpine-$KIMAI-dev
|
||||
volumes:
|
||||
- fpm-kimai:/opt/kimai
|
||||
|
||||
volumes:
|
||||
fpm-kimai:
|
||||
14
compose/docker-compose.fpm.prod.yml
Normal file
14
compose/docker-compose.fpm.prod.yml
Normal file
@ -0,0 +1,14 @@
|
||||
# example composer file for the fpm-alpine image
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:fpm-alpine-$KIMAI-prod
|
||||
environment:
|
||||
- APP_ENV=prod
|
||||
volumes:
|
||||
- fpm-kimai:/opt/kimai
|
||||
|
||||
volumes:
|
||||
fpm-kimai:
|
||||
|
||||
28
compose/docker-compose.ldap.yml
Normal file
28
compose/docker-compose.ldap.yml
Normal file
@ -0,0 +1,28 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
volumes:
|
||||
- ./local.yaml:/opt/kimai/config/packages/local.yaml
|
||||
|
||||
ldap:
|
||||
image: osixia/openldap:1.3.0
|
||||
ports:
|
||||
- 389:389
|
||||
environment:
|
||||
LDAP_ADMIN_PASSWORD: password123
|
||||
volumes:
|
||||
- ./ldap-seed.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif
|
||||
command: --copy-service
|
||||
|
||||
ldapadmin:
|
||||
image: dinkel/phpldapadmin
|
||||
links:
|
||||
- ldap:openldap
|
||||
ports:
|
||||
- 8003:80
|
||||
environment:
|
||||
LDAP_SERVER_HOST: ldap
|
||||
LDAP_SERVER_PORT: 389
|
||||
restart: always
|
||||
|
||||
25
compose/docker-compose.mysql.yml
Normal file
25
compose/docker-compose.mysql.yml
Normal file
@ -0,0 +1,25 @@
|
||||
# example composer file for the fpm-alpine image
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
environment:
|
||||
- DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai
|
||||
|
||||
sqldb:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
- MYSQL_DATABASE=kimai
|
||||
- MYSQL_USER=kimaiuser
|
||||
- MYSQL_PASSWORD=kimaipassword
|
||||
- MYSQL_ROOT_PASSWORD=changemeplease
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
command: --default-storage-engine innodb
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: mysqladmin -pchangemeplease ping -h localhost
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
35
compose/docker-compose.nginx.yml
Normal file
35
compose/docker-compose.nginx.yml
Normal file
@ -0,0 +1,35 @@
|
||||
# example composer file for the fpm-alpine image
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
kimai:
|
||||
volumes:
|
||||
- fpm-var:/opt/kimai/var
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx || exit 1
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
nginx:
|
||||
build: .
|
||||
ports:
|
||||
- 8002:80
|
||||
volumes:
|
||||
- ./nginx_site.conf:/etc/nginx/conf.d/default.conf
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- kimai
|
||||
volumes:
|
||||
- fpm-kimai:/opt/kimai
|
||||
- fpm-var:/opt/kimai/var
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx/health || exit 1
|
||||
interval: 20s
|
||||
start_period: 10s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
fpm-var:
|
||||
52
compose/ldap-seed.ldif
Executable file
52
compose/ldap-seed.ldif
Executable file
@ -0,0 +1,52 @@
|
||||
version: 1
|
||||
|
||||
# Entry 3: ou=groups,dc=example,dc=org
|
||||
dn: ou=groups,dc=example,dc=org
|
||||
objectclass: organizationalUnit
|
||||
objectclass: top
|
||||
ou: groups
|
||||
|
||||
# Entry 4: cn=staff,ou=groups,dc=example,dc=org
|
||||
dn: cn=staff,ou=groups,dc=example,dc=org
|
||||
cn: staff
|
||||
gidnumber: 500
|
||||
objectclass: posixGroup
|
||||
objectclass: top
|
||||
|
||||
# Entry 5: ou=users,dc=example,dc=org
|
||||
dn: ou=users,dc=example,dc=org
|
||||
objectclass: organizationalUnit
|
||||
objectclass: top
|
||||
ou: users
|
||||
|
||||
# Entry 6: cn=Lenny ldap,ou=users,dc=example,dc=org
|
||||
dn: cn=Lenny ldap,ou=users,dc=example,dc=org
|
||||
cn: Lenny ldap
|
||||
gidnumber: 500
|
||||
givenname: Lenny
|
||||
homedirectory: /home/users/lenny
|
||||
loginshell: /bin/sh
|
||||
mail: lenny@example.com
|
||||
objectclass: inetOrgPerson
|
||||
objectclass: posixAccount
|
||||
objectclass: top
|
||||
sn: ldap
|
||||
uid: lenny
|
||||
uidnumber: 1000
|
||||
userpassword: {MD5}SCyBHaXVtLxtSX/6mEkeOA==
|
||||
|
||||
# Entry 7: uid=billy,dc=example,dc=org
|
||||
dn: uid=billy,dc=example,dc=org
|
||||
cn: billy
|
||||
gecos: Billy User
|
||||
gidnumber: 14564100
|
||||
homedirectory: /home/billy
|
||||
loginshell: /bin/bash
|
||||
mail: billy@example.org
|
||||
objectclass: top
|
||||
objectclass: posixAccount
|
||||
objectclass: inetOrgPerson
|
||||
sn: 3
|
||||
uid: billy
|
||||
uidnumber: 14583102
|
||||
userpassword: {SSHA}5et/8Jrdgo55zIIM8fiVw6GEv4bRoBFx
|
||||
20
compose/local.yaml
Normal file
20
compose/local.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
kimai:
|
||||
ldap:
|
||||
connection:
|
||||
host: ldap
|
||||
username: cn=admin,dc=example,dc=org
|
||||
password: password123
|
||||
user:
|
||||
baseDn: ou=users,dc=example,dc=org
|
||||
role:
|
||||
baseDn: ou=groups,dc=example,dc=org
|
||||
|
||||
security:
|
||||
providers:
|
||||
chain_provider:
|
||||
chain:
|
||||
providers: [kimai_ldap]
|
||||
firewalls:
|
||||
secured_area:
|
||||
kimai_ldap: ~
|
||||
|
||||
48
compose/nginx_site.conf
Normal file
48
compose/nginx_site.conf
Normal file
@ -0,0 +1,48 @@
|
||||
server {
|
||||
listen 80;
|
||||
index index.php;
|
||||
server_name php-docker.local;
|
||||
root /opt/kimai/public;
|
||||
|
||||
# cache static asset files
|
||||
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
|
||||
expires max;
|
||||
log_not_found off;
|
||||
}
|
||||
|
||||
# for health checks
|
||||
location /health {
|
||||
return 200 'alive';
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
location / {
|
||||
# try to serve file directly, fallback to index.php
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/index\.php(/|$) {
|
||||
fastcgi_pass kimai:9000;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
|
||||
# optionally set the value of the environment variables used in the application
|
||||
# fastcgi_param APP_ENV prod;
|
||||
# fastcgi_param APP_SECRET <app-secret-id>;
|
||||
# fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
|
||||
|
||||
# When you are using symlinks to link the document root to the
|
||||
# current version of your application, you should pass the real
|
||||
# application path instead of the path to the symlink to PHP
|
||||
# FPM.
|
||||
# Otherwise, PHP's OPcache may not properly detect changes to
|
||||
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
|
||||
# for more information).
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||
# Prevents URIs that include the front controller. This will 404:
|
||||
# http://domain.tld/index.php/some-path
|
||||
# Remove the internal directive to allow URIs like this
|
||||
internal;
|
||||
}
|
||||
}
|
||||
BIN
data/ca.pem
Normal file
BIN
data/ca.pem
Normal file
Binary file not shown.
BIN
data/client-cert.pem
Normal file
BIN
data/client-cert.pem
Normal file
Binary file not shown.
BIN
data/public_key.pem
Normal file
BIN
data/public_key.pem
Normal file
Binary file not shown.
BIN
data/server-cert.pem
Normal file
BIN
data/server-cert.pem
Normal file
Binary file not shown.
91
docker-compose.yml
Normal file
91
docker-compose.yml
Normal file
@ -0,0 +1,91 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
sqldb:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
- MYSQL_DATABASE=kimai
|
||||
- MYSQL_USER=kimaiuser
|
||||
- MYSQL_PASSWORD=kimaipassword
|
||||
- MYSQL_ROOT_PASSWORD=changemeplease
|
||||
volumes:
|
||||
- ./data:/var/lib/mysql
|
||||
command: --default-storage-engine innodb
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: mysqladmin -pchangemeplease ping -h localhost
|
||||
interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
nginx:
|
||||
build: compose
|
||||
# ports:
|
||||
# - 8001:80
|
||||
environment:
|
||||
- VIRTUAL_HOST=time.franv.site
|
||||
- LETSENCRYPT_HOST=time.franv.site
|
||||
- LETSENCRYPT_EMAIL=ouch@thetrauma.org
|
||||
- VIRTUAL_PORT=8001
|
||||
- TRUSTED_PROXY=nginx-proxy
|
||||
|
||||
|
||||
volumes:
|
||||
- ./compose/nginx_site.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- public:/opt/kimai/public:ro
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- kimai
|
||||
# healthcheck:
|
||||
# test: wget --spider http://nginx/health || exit 1
|
||||
# interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:fpm-alpine-1.5-prod
|
||||
environment:
|
||||
- APP_ENV=prod
|
||||
- TRUSTED_HOSTS=time.franv.site
|
||||
# - TRUSTED_HOSTS=167.86.125.173
|
||||
# - TRUSTED_PROXY=nginx-proxy
|
||||
# - VIRTUAL_HOST=time.franv.site
|
||||
# - LETSENCRYPT_HOST=time.franv.site
|
||||
# - LETSENCRYPT_EMAIL=ouch@thetrauma.org
|
||||
# - VIRTUAL_PORT=8001
|
||||
|
||||
|
||||
- ADMINMAIL=admin@kimai.local
|
||||
- ADMINPASS=changemeplease
|
||||
volumes:
|
||||
- public:/opt/kimai/public
|
||||
- var:/opt/kimai/var
|
||||
# - ./ldap.conf:/etc/openldap/ldap.conf:z
|
||||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx || exit 1
|
||||
interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
# postfix:
|
||||
# image: catatnight/postfix:latest
|
||||
# environment:
|
||||
# maildomain: neontribe.co.uk
|
||||
# smtp_user: kimai:kimai
|
||||
# restart: unless-stopped
|
||||
# restart: always
|
||||
|
||||
volumes:
|
||||
var:
|
||||
public:
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: franvproxy_proxy-tier
|
||||
|
||||
86
docker-compose.yml.good
Normal file
86
docker-compose.yml.good
Normal file
@ -0,0 +1,86 @@
|
||||
version: '3.5'
|
||||
services:
|
||||
|
||||
sqldb:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
- MYSQL_DATABASE=kimai
|
||||
- MYSQL_USER=kimaiuser
|
||||
- MYSQL_PASSWORD=kimaipassword
|
||||
- MYSQL_ROOT_PASSWORD=changemeplease
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
command: --default-storage-engine innodb
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: mysqladmin -pchangemeplease ping -h localhost
|
||||
interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
nginx:
|
||||
build: compose
|
||||
ports:
|
||||
- 8001:80
|
||||
# environment:
|
||||
# - VIRTUAL_PORT=8001
|
||||
|
||||
|
||||
volumes:
|
||||
- ./compose/nginx_site.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- public:/opt/kimai/public:ro
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- kimai
|
||||
# healthcheck:
|
||||
# test: wget --spider http://nginx/health || exit 1
|
||||
# interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
kimai:
|
||||
image: kimai/kimai2:fpm-alpine-1.5-prod
|
||||
environment:
|
||||
- APP_ENV=prod
|
||||
- TRUSTED_HOSTS=time.franv.site
|
||||
# - TRUSTED_HOSTS=167.86.125.173
|
||||
- VIRTUAL_HOST=time.franv.site
|
||||
- LETSENCRYPT_HOST=time.franv.site
|
||||
- LETSENCRYPT_EMAIL=ouch@thetrauma.org
|
||||
- VIRTUAL_PORT=8001
|
||||
|
||||
|
||||
- ADMINMAIL=admin@kimai.local
|
||||
- ADMINPASS=changemeplease
|
||||
volumes:
|
||||
- public:/opt/kimai/public
|
||||
- var:/opt/kimai/var
|
||||
# - ./ldap.conf:/etc/openldap/ldap.conf:z
|
||||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: wget --spider http://nginx || exit 1
|
||||
interval: 20s
|
||||
# start_period: 10s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
|
||||
postfix:
|
||||
image: catatnight/postfix:latest
|
||||
environment:
|
||||
maildomain: neontribe.co.uk
|
||||
smtp_user: kimai:kimai
|
||||
restart: unless-stopped
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
var:
|
||||
public:
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: proxy_proxy-tier
|
||||
|
||||
7
index.html
Normal file
7
index.html
Normal file
@ -0,0 +1,7 @@
|
||||
<br />
|
||||
<b>Fatal error</b>: Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Untrusted Host "localhost". in /opt/kimai/vendor/symfony/http-foundation/Request.php:1191
|
||||
Stack trace:
|
||||
#0 /opt/kimai/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php(41): Symfony\Component\HttpFoundation\Request->getHost()
|
||||
#1 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(298): Symfony\Component\HttpKernel\EventListener\ValidateRequestListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#2 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#3 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(235): Symfony\Component\EventDispatcher\Ev in <b>/opt/kimai/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php</b> on line <b>366</b><br />
|
||||
7
index.html.1
Normal file
7
index.html.1
Normal file
@ -0,0 +1,7 @@
|
||||
<br />
|
||||
<b>Fatal error</b>: Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Untrusted Host "localhost". in /opt/kimai/vendor/symfony/http-foundation/Request.php:1191
|
||||
Stack trace:
|
||||
#0 /opt/kimai/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php(41): Symfony\Component\HttpFoundation\Request->getHost()
|
||||
#1 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(298): Symfony\Component\HttpKernel\EventListener\ValidateRequestListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#2 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#3 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(235): Symfony\Component\EventDispatcher\Ev in <b>/opt/kimai/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php</b> on line <b>366</b><br />
|
||||
7
index.html.2
Normal file
7
index.html.2
Normal file
@ -0,0 +1,7 @@
|
||||
<br />
|
||||
<b>Fatal error</b>: Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Untrusted Host "localhost". in /opt/kimai/vendor/symfony/http-foundation/Request.php:1191
|
||||
Stack trace:
|
||||
#0 /opt/kimai/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php(41): Symfony\Component\HttpFoundation\Request->getHost()
|
||||
#1 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(298): Symfony\Component\HttpKernel\EventListener\ValidateRequestListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#2 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#3 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(235): Symfony\Component\EventDispatcher\Ev in <b>/opt/kimai/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php</b> on line <b>366</b><br />
|
||||
7
index.html.3
Normal file
7
index.html.3
Normal file
@ -0,0 +1,7 @@
|
||||
<br />
|
||||
<b>Fatal error</b>: Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Untrusted Host "localhost". in /opt/kimai/vendor/symfony/http-foundation/Request.php:1191
|
||||
Stack trace:
|
||||
#0 /opt/kimai/vendor/symfony/http-kernel/EventListener/ValidateRequestListener.php(41): Symfony\Component\HttpFoundation\Request->getHost()
|
||||
#1 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(298): Symfony\Component\HttpKernel\EventListener\ValidateRequestListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#2 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\EventDispatcher))
|
||||
#3 /opt/kimai/vendor/symfony/event-dispatcher/EventDispatcher.php(235): Symfony\Component\EventDispatcher\Ev in <b>/opt/kimai/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php</b> on line <b>366</b><br />
|
||||
164
index.html.4
Normal file
164
index.html.4
Normal file
@ -0,0 +1,164 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-GB"
|
||||
dir="ltr"
|
||||
class="">
|
||||
<head>
|
||||
<title>BookStack</title>
|
||||
|
||||
<!-- Meta -->
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="token" content="VjU4JxcjgyqqajKKhYVK3Fv3dXxrruO10lQaE2QA">
|
||||
<meta name="base-url" content="http://localhost:9090">
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!-- Styles and Fonts -->
|
||||
<link rel="stylesheet" href="http://localhost:9090/dist/styles.css?version=v0.29.3">
|
||||
<link rel="stylesheet" media="print" href="http://localhost:9090/dist/print-styles.css?version=v0.29.3">
|
||||
|
||||
|
||||
<!-- Custom Styles & Head Content -->
|
||||
<style id="custom-styles" data-color="#206ea7" data-color-light="rgba(32,110,167,0.15)">
|
||||
:root {
|
||||
--color-primary: #206ea7;
|
||||
--color-primary-light: rgba(32,110,167,0.15);
|
||||
--color-bookshelf: #a94747;
|
||||
--color-book: #077b70;
|
||||
--color-chapter: #af4d0d;
|
||||
--color-page: #206ea7;
|
||||
--color-page-draft: #7e50b1;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!-- Translations for JS -->
|
||||
</head>
|
||||
<body class="">
|
||||
|
||||
<div notification="success" style="display: none;" data-autohide class="pos" role="alert" >
|
||||
<svg class="svg-icon" data-icon="check-circle" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div notification="warning" style="display: none;" class="warning" role="alert" >
|
||||
<svg class="svg-icon" data-icon="info" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div notification="error" style="display: none;" class="neg" role="alert" >
|
||||
<svg class="svg-icon" data-icon="danger" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
<header id="header" header-mobile-toggle class="primary-background">
|
||||
<div class="grid mx-l">
|
||||
|
||||
<div>
|
||||
<a href="http://localhost:9090" class="logo">
|
||||
<img class="logo-image" src="http://localhost:9090/logo.png" alt="Logo">
|
||||
<span class="logo-text">BookStack</span>
|
||||
</a>
|
||||
<div class="mobile-menu-toggle hide-over-l"><svg class="svg-icon" data-icon="more" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div class="header-search hide-under-l">
|
||||
</div>
|
||||
|
||||
<div class="text-right">
|
||||
<nav class="header-links">
|
||||
<div class="links text-center">
|
||||
|
||||
<a href="http://localhost:9090/login"><svg class="svg-icon" data-icon="login" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3z"/>
|
||||
</svg>Log in</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div id="content" class="block">
|
||||
|
||||
<div class="container very-small">
|
||||
|
||||
<div class="my-l"> </div>
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
<h1 class="list-heading">Log In</h1>
|
||||
|
||||
<form action="http://localhost:9090/login" method="POST" id="login-form" class="mt-l">
|
||||
<input type="hidden" name="_token" value="VjU4JxcjgyqqajKKhYVK3Fv3dXxrruO10lQaE2QA">
|
||||
|
||||
<div class="stretch-inputs">
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="text" id="email" name="email"
|
||||
autofocus >
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" name="password"
|
||||
>
|
||||
<div class="small mt-s">
|
||||
<a href="http://localhost:9090/password/email">Forgot Password?</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid half collapse-xs gap-xl v-center">
|
||||
<div class="text-left ml-xxs">
|
||||
<label custom-checkbox class="toggle-switch ">
|
||||
<input type="checkbox" name="remember" value="on" >
|
||||
<span tabindex="0" role="checkbox"
|
||||
aria-checked="false"
|
||||
class="custom-checkbox text-primary"><svg class="svg-icon" data-icon="check" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.86 4.118l-9.733 9.609-3.951-3.995-2.98 2.966 6.93 7.184L21.805 7.217z"/></svg></span>
|
||||
<span class="label">Remember Me</span>
|
||||
</label> </div>
|
||||
|
||||
<div class="text-right">
|
||||
<button class="button">Log In</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div back-to-top class="primary-background print-hidden">
|
||||
<div class="inner">
|
||||
<svg class="svg-icon" data-icon="chevron-up" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg> <span>Back to top</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="http://localhost:9090/dist/app.js?version=v0.29.3"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
164
index.html.5
Normal file
164
index.html.5
Normal file
@ -0,0 +1,164 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-GB"
|
||||
dir="ltr"
|
||||
class="">
|
||||
<head>
|
||||
<title>BookStack</title>
|
||||
|
||||
<!-- Meta -->
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="token" content="9052P2ltRPCyB4covB3cEmc2XdTrey1A4vNxT7MR">
|
||||
<meta name="base-url" content="http://localhost:9090">
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!-- Styles and Fonts -->
|
||||
<link rel="stylesheet" href="http://localhost:9090/dist/styles.css?version=v0.29.3">
|
||||
<link rel="stylesheet" media="print" href="http://localhost:9090/dist/print-styles.css?version=v0.29.3">
|
||||
|
||||
|
||||
<!-- Custom Styles & Head Content -->
|
||||
<style id="custom-styles" data-color="#206ea7" data-color-light="rgba(32,110,167,0.15)">
|
||||
:root {
|
||||
--color-primary: #206ea7;
|
||||
--color-primary-light: rgba(32,110,167,0.15);
|
||||
--color-bookshelf: #a94747;
|
||||
--color-book: #077b70;
|
||||
--color-chapter: #af4d0d;
|
||||
--color-page: #206ea7;
|
||||
--color-page-draft: #7e50b1;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!-- Translations for JS -->
|
||||
</head>
|
||||
<body class="">
|
||||
|
||||
<div notification="success" style="display: none;" data-autohide class="pos" role="alert" >
|
||||
<svg class="svg-icon" data-icon="check-circle" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div notification="warning" style="display: none;" class="warning" role="alert" >
|
||||
<svg class="svg-icon" data-icon="info" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div notification="error" style="display: none;" class="neg" role="alert" >
|
||||
<svg class="svg-icon" data-icon="danger" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg> <span></span><div class="dismiss"><svg class="svg-icon" data-icon="close" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
<header id="header" header-mobile-toggle class="primary-background">
|
||||
<div class="grid mx-l">
|
||||
|
||||
<div>
|
||||
<a href="http://localhost:9090" class="logo">
|
||||
<img class="logo-image" src="http://localhost:9090/logo.png" alt="Logo">
|
||||
<span class="logo-text">BookStack</span>
|
||||
</a>
|
||||
<div class="mobile-menu-toggle hide-over-l"><svg class="svg-icon" data-icon="more" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
|
||||
</svg></div>
|
||||
</div>
|
||||
|
||||
<div class="header-search hide-under-l">
|
||||
</div>
|
||||
|
||||
<div class="text-right">
|
||||
<nav class="header-links">
|
||||
<div class="links text-center">
|
||||
|
||||
<a href="http://localhost:9090/login"><svg class="svg-icon" data-icon="login" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3z"/>
|
||||
</svg>Log in</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div id="content" class="block">
|
||||
|
||||
<div class="container very-small">
|
||||
|
||||
<div class="my-l"> </div>
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
<h1 class="list-heading">Log In</h1>
|
||||
|
||||
<form action="http://localhost:9090/login" method="POST" id="login-form" class="mt-l">
|
||||
<input type="hidden" name="_token" value="9052P2ltRPCyB4covB3cEmc2XdTrey1A4vNxT7MR">
|
||||
|
||||
<div class="stretch-inputs">
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="text" id="email" name="email"
|
||||
autofocus >
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" name="password"
|
||||
>
|
||||
<div class="small mt-s">
|
||||
<a href="http://localhost:9090/password/email">Forgot Password?</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid half collapse-xs gap-xl v-center">
|
||||
<div class="text-left ml-xxs">
|
||||
<label custom-checkbox class="toggle-switch ">
|
||||
<input type="checkbox" name="remember" value="on" >
|
||||
<span tabindex="0" role="checkbox"
|
||||
aria-checked="false"
|
||||
class="custom-checkbox text-primary"><svg class="svg-icon" data-icon="check" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.86 4.118l-9.733 9.609-3.951-3.995-2.98 2.966 6.93 7.184L21.805 7.217z"/></svg></span>
|
||||
<span class="label">Remember Me</span>
|
||||
</label> </div>
|
||||
|
||||
<div class="text-right">
|
||||
<button class="button">Log In</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div back-to-top class="primary-background print-hidden">
|
||||
<div class="inner">
|
||||
<svg class="svg-icon" data-icon="chevron-up" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/>
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
</svg> <span>Back to top</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="http://localhost:9090/dist/app.js?version=v0.29.3"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
24
kimai-export.csv
Normal file
24
kimai-export.csv
Normal file
@ -0,0 +1,24 @@
|
||||
Date,From,To,Duration,Rate,User,Customer,Project,Activity,Description,Exported,Tags,Hourly rate,Fixed rate
|
||||
2020-07-15,17:25,18:02,2220,0.00,livan,StJohn,T-3010_St John Society and Foundation,T-3010 Foundation,,Open,, CAD 46.50 ,
|
||||
2020-07-17,08:36,10:54,8280,0.00,livan,StJohn,T-3010_St John Society and Foundation,T-3010 Foundation,,Open,, CAD 46.50 ,
|
||||
2020-07-17,11:25,12:37,4320,0.00,livan,StJohn,Financial Statements Updates,MR report review and update,,Open,, CAD 46.50 ,
|
||||
2020-07-17,13:03,13:49,2760,0.00,livan,StJohn,Financial Statements Updates,MR report review and update,,Open,, CAD 46.50 ,
|
||||
2020-07-17,14:00,15:30,5400,0.00,livan,StJohn,IT problem solving,IT-Email issues,,Open,, CAD 46.50 ,
|
||||
2020-07-17,15:38,17:40,7320,0.00,livan,StJohn,Financial Statements Updates,MR report review and update,,Open,, CAD 46.50 ,
|
||||
2020-07-18,09:59,11:00,3660,0.00,livan,StJohn,YE Closing,GP YE Closing,"GP FY2019 St John Society Closing - Close Sales,Purchase, When close Fiscal Year, system error. Check with National Office.",Open,, CAD 46.50 ,
|
||||
2020-07-20,10:03,11:19,4560,0.00,livan,StJohn,Meetings,Finance Team Meeting - Training,Petty Cash,Open,, CAD 46.50 ,
|
||||
2020-07-20,11:29,11:46,1020,0.00,livan,StJohn,Routine Tasks,AP - Payment Planning,"CC payment for Karen's approval, Corporate Traveler account for Instructor's booking.",Open,, CAD 46.50 ,
|
||||
2020-07-20,11:46,12:00,840,0.00,livan,StJohn,Gaming report & application,Gaming Report,Change appendix A report,Open,, CAD 46.50 ,
|
||||
2020-07-20,12:30,13:34,3840,0.00,livan,StJohn,Routine Tasks,AP - Payment Planning,"Sign CHQ Payments and EFT submission, review Cashflow report and open mails,",Open,, CAD 46.50 ,
|
||||
2020-07-20,13:35,14:00,1500,0.00,livan,StJohn,Routine Tasks,AP - Payment Planning,"Sign cheques, Cash flow update and correction.",Open,, CAD 46.50 ,
|
||||
2020-07-20,14:05,16:15,7800,0.00,livan,StJohn,T-3010_St John Society and Foundation,T3010-St John Society,Prepare Back up Files for approval,Open,, CAD 46.50 ,
|
||||
2020-07-20,16:14,16:49,2100,0.00,livan,StJohn,Meetings,Finance Team Meeting - Training,"AR sales filing process, HR (CRA Grants and Contributions Direct Deposit Form), AR Aged list Review with Vera,
|
||||
Month end progress update with AR team and Vera.",Open,, CAD 46.50 ,
|
||||
2020-07-22,09:16,10:23,4020,0.00,livan,StJohn,Month End Closing,Month end closing JE,Payroll JE for June 2020 and Accrual JE,Open,, CAD 46.50 ,
|
||||
2020-07-22,10:23,10:26,180,0.00,livan,StJohn,Meetings,Finance Team Meeting - Training,Meeting with Winnie for her AR questions,Open,, CAD 46.50 ,
|
||||
2020-07-22,10:26,10:45,1140,0.00,livan,StJohn,Month End Closing,Month end closing JE,Vacation Balance Verification,Open,, CAD 46.50 ,
|
||||
2020-07-22,10:44,11:04,1200,0.00,livan,StJohn,Meetings,Finance Team Meeting - Training,Meeting with Winnie for her AR questions,Open,, CAD 46.50 ,
|
||||
2020-07-22,11:03,12:14,4260,0.00,livan,StJohn,Month End Closing,Month end closing JE,Vacation Balance Verification,Open,, CAD 46.50 ,
|
||||
2020-07-22,13:06,14:36,5400,0.00,livan,StJohn,Month End Closing,Project Cost reallocation,Health Canada FY2019 YE cost reallocation adjustment. Back out reversal JE 1629480. Recognize Def Revenue and Expense Jan - Jun 2020,Open,, CAD 46.50 ,
|
||||
2020-07-22,15:15,15:55,2400,0.00,livan,StJohn,IT problem solving,Server folders reallocation,Move folders for the server mapping,Open,, CAD 46.50 ,
|
||||
2020-07-22,18:05,18:23,1080,0.00,livan,StJohn,IT problem solving,Server folders reallocation,Move folders for the server mapping,Open,, CAD 46.50 ,
|
||||
|
14
ldap.conf
Normal file
14
ldap.conf
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# LDAP Defaults
|
||||
#
|
||||
|
||||
# See ldap.conf(5) for details
|
||||
# This file should be world readable but not world writable.
|
||||
|
||||
#BASE dc=example,dc=com
|
||||
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
|
||||
|
||||
#SIZELIMIT 12
|
||||
#TIMELIMIT 15
|
||||
#DEREF never
|
||||
TLS_CACERT /etc/ssl/certs/ROOT-CA.pem
|
||||
19
readme.md
Normal file
19
readme.md
Normal file
@ -0,0 +1,19 @@
|
||||
## Installing
|
||||
### Using apache-debian
|
||||
- run container with named volume mount for `/opt/kimai/var`
|
||||
> `docker run -p 8001:8001 --rm --name=Kimai2 -v kimai_var:/opt/kimai/var KIMAIIMAGE`
|
||||
### Using fpm-alpine
|
||||
- run compose file
|
||||
> `docker-compose up -d`
|
||||
|
||||
## Upgrading Kimai version
|
||||
### Using apache-debian
|
||||
- stop your container
|
||||
- run new version and mount you named `/opt/kimai/var` volume into container
|
||||
### Using fpm-alpine
|
||||
- stop all containers with compose
|
||||
- change kimai image in compose file
|
||||
- delete the kimai `source` volume (NOT THE `var`)
|
||||
(this volume will only be used to share kimai source with the nginx webserver.
|
||||
delete forces to recreate and use the new, updated kimai sources )
|
||||
- restart your compose file
|
||||
53
startup.sh
Executable file
53
startup.sh
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo $KIMAI
|
||||
|
||||
function waitForDB() {
|
||||
# Parse sql connection data
|
||||
# todo: port is not used atm
|
||||
DB_TYPE=$(awk -F '[/:@]' '{print $1}' <<< $DATABASE_URL)
|
||||
DB_USER=$(awk -F '[/:@]' '{print $4}' <<< $DATABASE_URL)
|
||||
DB_PASS=$(awk -F '[/:@]' '{print $5}' <<< $DATABASE_URL)
|
||||
DB_HOST=$(awk -F '[/:@]' '{print $6}' <<< $DATABASE_URL)
|
||||
DB_BASE=$(awk -F '[/:@]' '{print $7}' <<< $DATABASE_URL)
|
||||
|
||||
# If we use mysql wait until its online
|
||||
if [[ $DB_TYPE == "mysql" ]]; then
|
||||
echo "Using Mysql DB"
|
||||
echo "Wait for db connection ..."
|
||||
until php -r "new PDO(\"mysql:host=$DB_HOST;dbname=$DB_BASE\", \"$DB_USER\", \"$DB_PASS\");" &> /dev/null; do
|
||||
sleep 3
|
||||
done
|
||||
echo "Connection established"
|
||||
else
|
||||
echo "Using non mysql DB"
|
||||
fi
|
||||
}
|
||||
|
||||
function handleStartup() {
|
||||
# first start?
|
||||
if ! [ -e /opt/kimai/installed ]; then
|
||||
echo "first run - install kimai"
|
||||
/opt/kimai/bin/console -n kimai:install
|
||||
if [ ! -z "$ADMINPASS" ] && [ ! -a "$ADMINMAIL" ]; then
|
||||
/opt/kimai/bin/console kimai:create-user superadmin $ADMINMAIL ROLE_SUPER_ADMIN $ADMINPASS
|
||||
fi
|
||||
echo $KIMAI > /opt/kimai/installed
|
||||
fi
|
||||
echo "Kimai2 ready"
|
||||
}
|
||||
|
||||
function runServer() {
|
||||
if [ -e /use_apache ]; then
|
||||
/usr/sbin/apache2ctl -D FOREGROUND
|
||||
elif [ -e /use_fpm ]; then
|
||||
exec php-fpm
|
||||
else
|
||||
echo "Error, unknown server type"
|
||||
fi
|
||||
}
|
||||
|
||||
waitForDB
|
||||
handleStartup
|
||||
runServer
|
||||
exit
|
||||
20
unittest.sh
Executable file
20
unittest.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/API || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Calendar || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Command || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Configuration || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Controller || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/DataFixtures || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Doctrine || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Entity || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Event || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/EventSubscriber || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Export || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Invoice || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Model || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Repository || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Security || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Timesheet || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Twig || exit 1
|
||||
#/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Utils || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Validator || exit 1
|
||||
/opt/kimai/vendor/bin/phpunit /opt/kimai/tests/Voter || exit 1
|
||||
44
visu.py
Executable file
44
visu.py
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/python3
|
||||
|
||||
# python3 ./visu.py | sudo docker run --rm -i vladgolubev/dot2png > file.png && xviewer file.png
|
||||
|
||||
import re
|
||||
|
||||
conns = []
|
||||
layer = ""
|
||||
|
||||
def parseLine(line, actual_layer):
|
||||
from_re = re.match("FROM (.*) AS (.*)", line)
|
||||
if from_re:
|
||||
actual_layer = from_re.group(2)
|
||||
if ":" in from_re.group(1):
|
||||
conns.append("\"" + from_re.group(1) + "\" [shape=box]")
|
||||
conn = "\"" + from_re.group(1) + "\" -> \"" + from_re.group(2) + "\""
|
||||
if not conn in conns:
|
||||
conns.append(conn)
|
||||
|
||||
copy_re = re.match("COPY --from=([a-z-_]*)", line)
|
||||
if copy_re:
|
||||
conn = "\"" + copy_re.group(1) + "\" -> \"" + actual_layer + "\"[style=dashed]"
|
||||
if not conn in conns:
|
||||
conns.append(conn)
|
||||
return actual_layer
|
||||
|
||||
|
||||
|
||||
file = open("Dockerfile", "r")
|
||||
conns.append("digraph {")
|
||||
# conns.append("rankdir=LR;")
|
||||
line = file.readline()
|
||||
while line:
|
||||
line = file.readline()
|
||||
if "${BASE}" in line:
|
||||
layer = parseLine(line.replace("${BASE}", "fpm-alpine"), layer)
|
||||
layer = parseLine(line.replace("${BASE}", "apache-debian"), layer)
|
||||
else:
|
||||
layer = parseLine(line, layer)
|
||||
conns.append("}")
|
||||
|
||||
|
||||
for line in conns:
|
||||
print(line)
|
||||
Loading…
Reference in New Issue
Block a user