-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wording to warn about the non-production state of the fpm proxy image
- Loading branch information
1 parent
387bccb
commit a783365
Showing
1 changed file
with
93 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,21 +4,23 @@ description: Running Kimai with Docker compose | |
canonical: /documentation/docker-compose.html | ||
--- | ||
|
||
This will run the latest prod version using FPM with an nginx reverse proxy: | ||
Several docker-compose example files that use the latest Kimai version. | ||
|
||
## Apache (prod) | ||
|
||
```dockerfile | ||
version: '3.5' | ||
services: | ||
|
||
sqldb: | ||
image: mysql:5.7 | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
environment: | ||
- MYSQL_DATABASE=kimai | ||
- MYSQL_USER=kimaiuser | ||
- MYSQL_PASSWORD=kimaipassword | ||
- MYSQL_ROOT_PASSWORD=changemeplease | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
command: --default-storage-engine innodb | ||
restart: unless-stopped | ||
healthcheck: | ||
|
@@ -28,79 +30,25 @@ services: | |
timeout: 10s | ||
retries: 3 | ||
|
||
nginx: | ||
image: tobybatch/nginx-fpm-reverse-proxy | ||
ports: | ||
- 8001:80 | ||
volumes: | ||
- 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:latest | ||
image: kimai/kimai2:apache | ||
volumes: | ||
- data:/opt/kimai/var/data | ||
ports: | ||
- 8001:8001 | ||
environment: | ||
- [email protected] | ||
- ADMINPASS=changemeplease | ||
- DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai?charset=utf8mb4&serverVersion=5.7.40 | ||
- "DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai?charset=utf8mb4&serverVersion=5.7.40" | ||
- TRUSTED_HOSTS=nginx,localhost,127.0.0.1 | ||
- MAILER_URL=smtp://mailer:1025 | ||
- [email protected] | ||
volumes: | ||
- public:/opt/kimai/public | ||
# - data:/opt/kimai/var/data | ||
# - ./ldap.conf:/etc/openldap/ldap.conf:z | ||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z | ||
restart: unless-stopped | ||
|
||
phpmyadmin: | ||
image: phpmyadmin | ||
restart: always | ||
ports: | ||
- 8081:80 | ||
environment: | ||
- PMA_ARBITRARY=1 | ||
|
||
swagger: | ||
image: swaggerapi/swagger-ui | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ./swagger.json:/swagger.json | ||
environment: | ||
- SWAGGER_JSON=/swagger.json | ||
|
||
mailer: | ||
image: schickling/mailcatcher | ||
ports: | ||
- "${MAILER_SMTP_PORT:-1025}:1025" | ||
- "${MAILER_ADMIN_PORT:-1080}:1080" | ||
|
||
volumes: | ||
data: | ||
public: | ||
mysql: | ||
``` | ||
|
||
## More examples | ||
|
||
Listed here are example setups for running the image(s). | ||
If you'd like to contribute a new one them please [raise a PR for this page](https://github.com/kimai/www.kimai.org/edit/main/_documentation/docker/docker-compose.md). | ||
|
||
Be aware that none of these images persist the DB between restarts, unless you add a volume to do that: | ||
```dockerfile | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
data: | ||
mysql: | ||
``` | ||
|
||
### Apache dev | ||
## Apache (dev) | ||
|
||
```dockerfile | ||
version: '3.5' | ||
|
@@ -134,16 +82,32 @@ services: | |
restart: unless-stopped | ||
``` | ||
|
||
### Apache prod | ||
## FPM and nginx | ||
|
||
Listed here are example setups for running the image(s). | ||
If you'd like to contribute a new one them please [raise a PR for this page](https://github.com/kimai/www.kimai.org/edit/main/_documentation/docker/docker-compose.md). | ||
|
||
None of these images persist the DB between restarts, unless you add a volume to do that: | ||
```dockerfile | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
``` | ||
|
||
{% capture proxImage %} | ||
Be aware that the below image [tobybatch/nginx-fpm-reverse-proxy](https://github.com/tobybatch/nginx-fpm-reverse-proxy) is only meant as example. | ||
It is not made for production usage. Use your existing reverse proxy instead! | ||
{% endcapture %} | ||
{% assign proxImage = proxImage|markdownify %} | ||
{% include alert.html icon="fas fa-exclamation" type="danger" alert=proxImage %} | ||
|
||
### Production | ||
|
||
```dockerfile | ||
version: '3.5' | ||
services: | ||
|
||
sqldb: | ||
image: mysql:5.7 | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
environment: | ||
- MYSQL_DATABASE=kimai | ||
- MYSQL_USER=kimaiuser | ||
|
@@ -158,26 +122,44 @@ services: | |
timeout: 10s | ||
retries: 3 | ||
|
||
kimai: | ||
image: kimai/kimai2:apache | ||
volumes: | ||
- data:/opt/kimai/var/data | ||
nginx: | ||
image: tobybatch/nginx-fpm-reverse-proxy | ||
ports: | ||
- 8001:8001 | ||
- 8001:80 | ||
volumes: | ||
- 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:latest | ||
environment: | ||
- [email protected] | ||
- ADMINPASS=changemeplease | ||
- "DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai?charset=utf8mb4&serverVersion=5.7.40" | ||
- TRUSTED_HOSTS=nginx,localhost,127.0.0.1 | ||
volumes: | ||
- public:/opt/kimai/public | ||
# - data:/opt/kimai/var/data | ||
# - ./ldap.conf:/etc/openldap/ldap.conf:z | ||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z | ||
restart: unless-stopped | ||
|
||
volumes: | ||
data: | ||
mysql: | ||
data: | ||
public: | ||
mysql: | ||
``` | ||
|
||
### FPM dev | ||
|
||
### With addons | ||
```dockerfile | ||
version: '3.5' | ||
services: | ||
|
@@ -189,6 +171,8 @@ services: | |
- MYSQL_USER=kimaiuser | ||
- MYSQL_PASSWORD=kimaipassword | ||
- MYSQL_ROOT_PASSWORD=changemeplease | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
command: --default-storage-engine innodb | ||
restart: unless-stopped | ||
healthcheck: | ||
|
@@ -215,25 +199,51 @@ services: | |
retries: 3 | ||
|
||
kimai: | ||
image: kimai/kimai2:fpm-dev | ||
image: kimai/kimai2:latest | ||
environment: | ||
- [email protected] | ||
- ADMINPASS=changemeplease | ||
- "DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai?charset=utf8mb4&serverVersion=5.7.40" | ||
- DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai?charset=utf8mb4&serverVersion=5.7.40 | ||
- TRUSTED_HOSTS=nginx,localhost,127.0.0.1 | ||
- MAILER_URL=smtp://mailer:1025 | ||
- [email protected] | ||
volumes: | ||
- public:/opt/kimai/public | ||
# - data:/opt/kimai/var/data | ||
# - ./ldap.conf:/etc/openldap/ldap.conf:z | ||
# - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z | ||
restart: unless-stopped | ||
|
||
phpmyadmin: | ||
image: phpmyadmin | ||
restart: always | ||
ports: | ||
- 8081:80 | ||
environment: | ||
- PMA_ARBITRARY=1 | ||
|
||
swagger: | ||
image: swaggerapi/swagger-ui | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ./swagger.json:/swagger.json | ||
environment: | ||
- SWAGGER_JSON=/swagger.json | ||
|
||
mailer: | ||
image: schickling/mailcatcher | ||
ports: | ||
- "${MAILER_SMTP_PORT:-1025}:1025" | ||
- "${MAILER_ADMIN_PORT:-1080}:1080" | ||
|
||
volumes: | ||
data: | ||
public: | ||
mysql: | ||
``` | ||
|
||
### FPM prod | ||
### Development | ||
|
||
```dockerfile | ||
version: '3.5' | ||
|
@@ -272,7 +282,7 @@ services: | |
retries: 3 | ||
|
||
kimai: | ||
image: kimai/kimai2:latest | ||
image: kimai/kimai2:fpm-dev | ||
environment: | ||
- [email protected] | ||
- ADMINPASS=changemeplease | ||
|
@@ -288,4 +298,5 @@ services: | |
volumes: | ||
data: | ||
public: | ||
mysql: | ||
``` |