Skip to content

Commit 791209c

Browse files
committed
Initial commit
Signed-off-by: Eric Nemchik <eric@nemchik.com>
1 parent efb8d77 commit 791209c

13 files changed

Lines changed: 287 additions & 0 deletions

File tree

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file is globally distributed to all container image projects from
2+
# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
12+
trim_trailing_whitespace = false
13+
14+
[{Dockerfile*,**.yml}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[{**.sh,root/etc/s6-overlay/s6-rc.d/**,root/etc/cont-init.d/**,root/etc/services.d/**}]
19+
indent_style = space
20+
indent_size = 4

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
7+
# Standard to msysgit
8+
*.doc diff=astextplain
9+
*.DOC diff=astextplain
10+
*.docx diff=astextplain
11+
*.DOCX diff=astextplain
12+
*.dot diff=astextplain
13+
*.DOT diff=astextplain
14+
*.pdf diff=astextplain
15+
*.PDF diff=astextplain
16+
*.rtf diff=astextplain
17+
*.RTF diff=astextplain

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
# Folder config file
6+
Desktop.ini
7+
8+
# Recycle Bin used on file shares
9+
$RECYCLE.BIN/
10+
11+
# Windows Installer files
12+
*.cab
13+
*.msi
14+
*.msm
15+
*.msp
16+
17+
# Windows shortcuts
18+
*.lnk
19+
20+
# =========================
21+
# Operating System Files
22+
# =========================
23+
24+
# OSX
25+
# =========================
26+
27+
.DS_Store
28+
.AppleDouble
29+
.LSOverride
30+
31+
# Thumbnails
32+
._*
33+
34+
# Files that might appear on external disk
35+
.Spotlight-V100
36+
.Trashes
37+
38+
# Directories potentially created on remote AFP share
39+
.AppleDB
40+
.AppleDesktop
41+
Network Trash Folder
42+
Temporary Items
43+
.apdisk
44+
.jenkins-external

Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.18
4+
5+
# set version label
6+
ARG BUILD_DATE
7+
ARG VERSION
8+
ARG KIMAI_RELEASE
9+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10+
LABEL maintainer="nemchik"
11+
12+
RUN \
13+
echo "**** install runtime packages ****" && \
14+
apk add --no-cache \
15+
php82-gd \
16+
php82-intl \
17+
php82-ldap \
18+
php82-pdo_mysql \
19+
php82-pecl-redis \
20+
php82-tokenizer \
21+
php82-xmlreader \
22+
php82-xsl && \
23+
echo "**** configure php-fpm to pass env vars ****" && \
24+
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
25+
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
26+
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf && \
27+
echo "**** install kimai ****" && \
28+
mkdir -p\
29+
/app/www && \
30+
if [ -z ${KIMAI_RELEASE+x} ]; then \
31+
KIMAI_RELEASE=$(curl -sX GET "https://api.github.com/repos/kimai/kimai/releases/latest" \
32+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
33+
fi && \
34+
curl -o \
35+
/tmp/kimai.tar.gz -L \
36+
"https://github.com/kimai/kimai/archive/refs/tags/${KIMAI_RELEASE}.tar.gz" && \
37+
tar xf \
38+
/tmp/kimai.tar.gz -C \
39+
/app/www --strip-components=1 && \
40+
rm -rf /app/www/var && \
41+
echo "**** install composer dependencies ****" && \
42+
COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 /usr/bin/composer install -d /app/www/ --optimize-autoloader --no-interaction && \
43+
echo "**** cleanup ****" && \
44+
rm -rf \
45+
/tmp/* \
46+
$HOME/.cache \
47+
$HOME/.composer
48+
49+
# add local files
50+
COPY root/ /
51+
52+
# ports and volumes
53+
EXPOSE 80 443
54+
VOLUME /config

Dockerfile.aarch64

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.18
4+
5+
# set version label
6+
ARG BUILD_DATE
7+
ARG VERSION
8+
ARG KIMAI_RELEASE
9+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10+
LABEL maintainer="nemchik"
11+
12+
RUN \
13+
echo "**** install runtime packages ****" && \
14+
apk add --no-cache \
15+
php82-gd \
16+
php82-intl \
17+
php82-ldap \
18+
php82-pdo_mysql \
19+
php82-pecl-redis \
20+
php82-tokenizer \
21+
php82-xmlreader \
22+
php82-xsl && \
23+
echo "**** configure php-fpm to pass env vars ****" && \
24+
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
25+
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
26+
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf && \
27+
echo "**** install kimai ****" && \
28+
mkdir -p\
29+
/app/www && \
30+
if [ -z ${KIMAI_RELEASE+x} ]; then \
31+
KIMAI_RELEASE=$(curl -sX GET "https://api.github.com/repos/kimai/kimai/releases/latest" \
32+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
33+
fi && \
34+
curl -o \
35+
/tmp/kimai.tar.gz -L \
36+
"https://github.com/kimai/kimai/archive/refs/tags/${KIMAI_RELEASE}.tar.gz" && \
37+
tar xf \
38+
/tmp/kimai.tar.gz -C \
39+
/app/www --strip-components=1 && \
40+
rm -rf /app/www/var && \
41+
echo "**** install composer dependencies ****" && \
42+
COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 /usr/bin/composer install -d /app/www/ --optimize-autoloader --no-interaction && \
43+
echo "**** cleanup ****" && \
44+
rm -rf \
45+
/tmp/* \
46+
$HOME/.cache \
47+
$HOME/.composer
48+
49+
# add local files
50+
COPY root/ /
51+
52+
# ports and volumes
53+
EXPOSE 80 443
54+
VOLUME /config

jenkins-vars.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
# jenkins variables
4+
project_name: docker-kimai
5+
external_type: github_stable
6+
release_type: stable
7+
release_tag: latest
8+
ls_branch: main
9+
build_armhf: false
10+
repo_vars:
11+
- EXT_GIT_BRANCH = '2.x'
12+
- EXT_USER = 'kimai'
13+
- EXT_REPO = 'kimai'
14+
- CONTAINER_NAME = 'kimai'
15+
- BUILD_VERSION_ARG = 'KIMAI_RELEASE'
16+
- LS_USER = 'linuxserver'
17+
- LS_REPO = 'docker-kimai'
18+
- DOCKERHUB_IMAGE = 'linuxserver/kimai'
19+
- DEV_DOCKERHUB_IMAGE = 'lsiodev/kimai'
20+
- PR_DOCKERHUB_IMAGE = 'lspipepr/kimai'
21+
- DIST_IMAGE = 'alpine'
22+
- MULTIARCH='true'
23+
- CI='true'
24+
- CI_WEB='true'
25+
- CI_PORT='80'
26+
- CI_SSL='false'
27+
- CI_DELAY='120'
28+
- CI_DOCKERENV='TZ=US/Pacific'
29+
- CI_AUTH='user:password'
30+
- CI_WEBPATH=''

readme-vars.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
3+
# project information
4+
project_name: kimai
5+
project_url: "https://kimai.org/"
6+
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kimai-logo.png"
7+
project_blurb: |
8+
[{{ project_name|capitalize }}]({{ project_url }}) is a professional grade time-tracking application, free and open-source.
9+
It handles use-cases of freelancers as well as companies with dozens or hundreds of users.
10+
Kimai was build to track your project times and ships with many advanced features, including but not limited to:
11+
12+
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.
13+
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
14+
15+
# supported architectures
16+
available_architectures:
17+
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
18+
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
19+
20+
# development version
21+
development_versions: false
22+
development_versions_items:
23+
- { tag: "latest", desc: "Stable Kimai releases." }
24+
25+
# container parameters
26+
common_param_env_vars_enabled: true
27+
param_container_name: "{{ project_name }}"
28+
param_usage_include_vols: true
29+
param_volumes:
30+
- { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Contains all relevant configuration files." }
31+
param_usage_include_ports: true
32+
param_ports:
33+
- { external_port: "80", internal_port: "80", port_desc: "http gui" }
34+
- { external_port: "443", internal_port: "443", port_desc: "https gui" }
35+
param_usage_include_env: true
36+
param_env_vars:
37+
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
38+
39+
# application setup block
40+
app_setup_block_enabled: true
41+
app_setup_block: |
42+
Access the web gui at http://SERVERIP:PORT
43+
44+
# changelog
45+
changelogs:
46+
- { date: "09.08.23:", desc: "Initial Release." }

root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-kimai-config

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/init-kimai-config/dependencies.d/init-nginx-end

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
# make our folders
5+
mkdir -p \
6+
/config/{cache,data,log,packages,plugins,sessions}
7+
8+
symlink -l /app/www/var /config
9+
10+
if [[ -n "${DATABASE_URL}" ]]; then
11+
cd /app/www || exit 1
12+
s6-setuidgid abc bin/console kimai:install -n
13+
s6-setuidgid abc bin/console kimai:update -n
14+
else
15+
echo "DATABASE_URL not set"
16+
sleep infinity
17+
fi
18+
19+
lsiown -R abc:abc \
20+
/config

0 commit comments

Comments
 (0)