Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Nemchik <[email protected]>
  • Loading branch information
nemchik committed Aug 9, 2023
1 parent efb8d77 commit 791209c
Show file tree
Hide file tree
Showing 13 changed files with 287 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is globally distributed to all container image projects from
# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
trim_trailing_whitespace = false

[{Dockerfile*,**.yml}]
indent_style = space
indent_size = 2

[{**.sh,root/etc/s6-overlay/s6-rc.d/**,root/etc/cont-init.d/**,root/etc/services.d/**}]
indent_style = space
indent_size = 4
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.jenkins-external
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.18

# set version label
ARG BUILD_DATE
ARG VERSION
ARG KIMAI_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="nemchik"

RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
php82-gd \
php82-intl \
php82-ldap \
php82-pdo_mysql \
php82-pecl-redis \
php82-tokenizer \
php82-xmlreader \
php82-xsl && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf && \
echo "**** install kimai ****" && \
mkdir -p\
/app/www && \
if [ -z ${KIMAI_RELEASE+x} ]; then \
KIMAI_RELEASE=$(curl -sX GET "https://api.github.com/repos/kimai/kimai/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/kimai.tar.gz -L \
"https://github.com/kimai/kimai/archive/refs/tags/${KIMAI_RELEASE}.tar.gz" && \
tar xf \
/tmp/kimai.tar.gz -C \
/app/www --strip-components=1 && \
rm -rf /app/www/var && \
echo "**** install composer dependencies ****" && \
COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 /usr/bin/composer install -d /app/www/ --optimize-autoloader --no-interaction && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
$HOME/.cache \
$HOME/.composer

# add local files
COPY root/ /

# ports and volumes
EXPOSE 80 443
VOLUME /config
54 changes: 54 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.18

# set version label
ARG BUILD_DATE
ARG VERSION
ARG KIMAI_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="nemchik"

RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
php82-gd \
php82-intl \
php82-ldap \
php82-pdo_mysql \
php82-pecl-redis \
php82-tokenizer \
php82-xmlreader \
php82-xsl && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf && \
echo "**** install kimai ****" && \
mkdir -p\
/app/www && \
if [ -z ${KIMAI_RELEASE+x} ]; then \
KIMAI_RELEASE=$(curl -sX GET "https://api.github.com/repos/kimai/kimai/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/kimai.tar.gz -L \
"https://github.com/kimai/kimai/archive/refs/tags/${KIMAI_RELEASE}.tar.gz" && \
tar xf \
/tmp/kimai.tar.gz -C \
/app/www --strip-components=1 && \
rm -rf /app/www/var && \
echo "**** install composer dependencies ****" && \
COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 /usr/bin/composer install -d /app/www/ --optimize-autoloader --no-interaction && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
$HOME/.cache \
$HOME/.composer

# add local files
COPY root/ /

# ports and volumes
EXPOSE 80 443
VOLUME /config
30 changes: 30 additions & 0 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

# jenkins variables
project_name: docker-kimai
external_type: github_stable
release_type: stable
release_tag: latest
ls_branch: main
build_armhf: false
repo_vars:
- EXT_GIT_BRANCH = '2.x'
- EXT_USER = 'kimai'
- EXT_REPO = 'kimai'
- CONTAINER_NAME = 'kimai'
- BUILD_VERSION_ARG = 'KIMAI_RELEASE'
- LS_USER = 'linuxserver'
- LS_REPO = 'docker-kimai'
- DOCKERHUB_IMAGE = 'linuxserver/kimai'
- DEV_DOCKERHUB_IMAGE = 'lsiodev/kimai'
- PR_DOCKERHUB_IMAGE = 'lspipepr/kimai'
- DIST_IMAGE = 'alpine'
- MULTIARCH='true'
- CI='true'
- CI_WEB='true'
- CI_PORT='80'
- CI_SSL='false'
- CI_DELAY='120'
- CI_DOCKERENV='TZ=US/Pacific'
- CI_AUTH='user:password'
- CI_WEBPATH=''
46 changes: 46 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---

# project information
project_name: kimai
project_url: "https://kimai.org/"
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kimai-logo.png"
project_blurb: |
[{{ project_name|capitalize }}]({{ project_url }}) is a professional grade time-tracking application, free and open-source.
It handles use-cases of freelancers as well as companies with dozens or hundreds of users.
Kimai was build to track your project times and ships with many advanced features, including but not limited to:
JSON API, invoicing, data exports, multi-timer and punch-in punch-out mode, tagging, multi-user - multi-timezones - multi-language ([over 30 translations existing](https://hosted.weblate.org/projects/kimai/)!), authentication via SAML/LDAP/Database, two-factor authentication (2FA) with TOTP, customizable role and team permissions, responsive design, user/customer/project specific rates, advanced search & filtering, money and time budgets, advanced reporting, support for [plugins](https://www.kimai.org/store/) and so much more.
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"

# supported architectures
available_architectures:
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}

# development version
development_versions: false
development_versions_items:
- { tag: "latest", desc: "Stable Kimai releases." }

# container parameters
common_param_env_vars_enabled: true
param_container_name: "{{ project_name }}"
param_usage_include_vols: true
param_volumes:
- { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Contains all relevant configuration files." }
param_usage_include_ports: true
param_ports:
- { external_port: "80", internal_port: "80", port_desc: "http gui" }
- { external_port: "443", internal_port: "443", port_desc: "https gui" }
param_usage_include_env: true
param_env_vars:
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}

# application setup block
app_setup_block_enabled: true
app_setup_block: |
Access the web gui at http://SERVERIP:PORT
# changelog
changelogs:
- { date: "09.08.23:", desc: "Initial Release." }
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/init-kimai-config/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# make our folders
mkdir -p \
/config/{cache,data,log,packages,plugins,sessions}

symlink -l /app/www/var /config

if [[ -n "${DATABASE_URL}" ]]; then
cd /app/www || exit 1
s6-setuidgid abc bin/console kimai:install -n
s6-setuidgid abc bin/console kimai:update -n
else
echo "DATABASE_URL not set"
sleep infinity
fi

lsiown -R abc:abc \
/config
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-kimai-config/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-kimai-config/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-kimai-config/run
Empty file.

0 comments on commit 791209c

Please sign in to comment.