In this section you will find some examples about how to use monica's docker images.
| Example | Description |
|---|---|
simple |
simple example that run a container. |
full |
example that run fpm-alpine with nginx, redis, separate cron and queue containers, and uses secrets. |
full_v5 |
example for v5 of monica (a.k.a chandler) that run fpm-alpine with nginx, redis, separate cron and queue containers, and uses secrets. |
supervisor |
uses supervisor to run a cron and a queue inside your container. |
nginx-proxy-self-signed-ssl |
shows you how to run monica with a self signed ssl certificate. |
nginx-proxy |
shows you how to run monica with https and generate a Let's Encrypt certificate. |
maxsize |
shows you how to adapt the max upload size of you php settings in the app container. |
raspberrypi |
shows you how to host monica on a raspberry pi. |
First, download a copy of Monica example configuration file:
curl -sS https://raw.githubusercontent.com/monicahq/monica/4.x/.env.example -o .envOpen the file in an editor and update it for your own needs:
- Set
APP_KEYto a random 32-character string. You can for instance copy and paste the output ofecho -n 'base64:'; openssl rand -base64 32. - Edit the
MAIL_*settings to point to your own mailserver. - Set
DB_*settings to point to your database configuration. If you don't want to set a db prefix, be careful to setDB_PREFIX=and notDB_PREFIX=''as docker will not expand this as an empty string. - Set
DB_HOST=dbor any name of the database container you will link to.
The supervisor examples shows you how to run monica with
- a db container (mariadb:11)
- an app container, which run
supervisordto handle a web server/fpm, a cron, and a queue.
This let you use QUEUE_CONNECTION=database in your .env file.
nginx-proxy-self-signed-ssl example shows you how to run monica with a self signed ssl certificate, to run the application in https mode.
Set VIRTUAL_HOST and SSL_SUBJECT with the right domain name, and update SSL_KEY, SSL_CSR, and SSL_CERT accordingly.
This example generates a new self-signed certificate.
Your browser might warn you about security issue, as a self-signed certificate is not trusted in production mode. For a real domain certificate, see the next section.
nginx-proxy example shows you how to run monica and generate a Let's Encrypt certificate for your domain.
Don't forget to set:
VIRTUAL_HOSTandLETSENCRYPT_HOSTwith your domainLETSENCRYPT_EMAILwith a valid emailAPP_URLin your.envfile with the right domain url
You may want to set APP_ENV=production to force the use of https scheme.
This example add a redis container, that can be used too, adding these variables to your .env file:
REDIS_HOST=redis: mandatory, whereredisis the name of the redis containerCACHE_DRIVER=redis: to use redis as a cache tableQUEUE_CONNECTION=redis: to use redis as a queue table