2019-07-09 17:47:37 +00:00
# Description
This image provides the nginx and apache version of the Kimai2 time tracking system. For more information about Kimai2, go [here ](https://www.kimai.org/ ).
# Features
Turn-key installation based on environment variables passed to the container. Creates initial super user on first install. Currently based on project's [master ](https://github.com/kevinpapst/kimai2/ ).
# Usage
## docker-compose (preferred)
The recommended way of running is by using [jwilder/nginx-proxy ](jwilder/nginx-proxy ) as follows.
### With nginx-proxy
For installations where there is a bridged network dedicated to nginx proxy:
```yml
version: '3.7'
services:
kimai:
image: bkraul/kimai2:nginx-alpine
volumes:
- /etc/localtime:/etc/localtime:ro
- ./local.yaml:/app/config/packages/local.yaml
environment:
# nginx-proxy
- VIRTUAL_HOST=kimai.mydomain.com
- PHP_DATE_TIMEZONE=America/Chicago
# kimai2
- APP_ENV=prod
- DATABASE_URL=mysql://validsqlurl
- MAILER_FROM=kimai@mydomain.com
- MAILER_URL=smtp://validsmtpurl
- APP_SECRET=Superdupersecret
# initial admin user
- APP_ADMIN_USER=master
- APP_ADMIN_EMAIL=master@mydomain.com
- APP_ADMIN_PASS=masterPassword
2019-07-14 17:37:57 +00:00
- APP_LOG=0
2019-07-09 17:47:37 +00:00
networks:
- reverse-proxy
networks:
reverse-proxy:
external:
name: reverse-proxy
```
### Without nginx-proxy
For installations without nginx-proxy, a port usually needs to be mapped. The exposed ports in the container are 80 and 443 (see here for how)
```
version: '3.7'
services:
kimai:
image: bkraul/kimai2:nginx-alpine
volumes:
- /etc/localtime:/etc/localtime:ro
- ./local.yaml:/app/config/packages/local.yaml
ports:
- '8001:80'
environment:
# web server
- PHP_DATE_TIMEZONE=America/Chicago
# kimai2
- APP_ENV=prod
- DATABASE_URL=mysql://validsqlurl
- MAILER_FROM=kimai@mydomain.com
- MAILER_URL=smtp://validsmtpurl
- APP_SECRET=Superdupersecret
# initial admin user
- APP_ADMIN_USER=master
- APP_ADMIN_EMAIL=master@mydomain.com
- APP_ADMIN_PASS=masterPassword
2019-07-14 17:37:57 +00:00
- APP_LOG=0
2019-07-09 17:47:37 +00:00
```
# Environment variables
* `PHP_DATE_TIMEZONE` : Sets the correct php timezone.
* `APP_ENV` : The current kimai environment, [`dev, prod (default)`]
* `DATABASE_URL` : Valid URL for database. Use `mysql://user:pass@server.tld/database`
* `MAILER_FROM` : The from address for the mailing system.
* `MAILER_URL` : Valid swift mailer format URL. i.e. `smtp://server.tld:25?encryption=ssl&auth_mode=login&username=&password=`
* `APP_SECRET` : The encryption secret for the app.
* `APP_ADMIN_USER` : The user name for the first super admin to be created automatically.
* `APP_ADMIN_EMAIL` : First super admin email.
2019-07-14 17:37:57 +00:00
* `APP_ADMIN_PASS` : First super admin password.
* `APP_LOG` : Pipe kimai2 log to the stdout.