-
Maintained by:
Monica Team -
Where to get help:
the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow
4.0.0-apache
,4.0-apache
,4-apache
,apache
,4.0.0
,4.0
,4
,latest
4.0.0-fpm-alpine
,4.0-fpm-alpine
,4-fpm-alpine
,fpm-alpine
4.0.0-fpm
,4.0-fpm
,4-fpm
,fpm
-
Where to file issues:
https://github.com/monicahq/docker/issues -
Supported architectures: (more info)
amd64
,arm32v5
,arm32v6
,arm32v7
,arm64v8
,i386
,mips64le
,ppc64le
,s390x
-
Published image artifact details:
repo-info repo'srepos/monica/
directory (history)
(image metadata, transfer size, etc) -
Image updates:
official-images repo'slibrary/monica
label
official-images repo'slibrary/monica
file (history) -
Source of this description:
docs repo'smonica/
directory (history)
Monica is a great open source personal relationship management system to organize the interactions with your loved ones.
There are two versions of the image you may choose from.
The apache
tag contains a full Monica installation with an apache webserver. This points to the default latest
tag too.
The fpm
tag contains a fastCGI-Process that serves the web pages. This image should be combined with a webserver used as a proxy, like apache or nginx.
This image contains a webserver that exposes port 80. Run the container with:
docker run --name some-monica -d -p 8080:80 monica
This image serves a fastCGI server that exposes port 9000. You may need an additional web server that can proxy requests to the fpm port 9000 of the container. Run this container with:
docker run --name some-monica -d -p 9000:9000 monica:fpm
You'll need to setup an external database. Monica currently support MySQL/MariaDB database. You can also link a database container, e. g. --link my-mysql:db
, and then use db
as the database host on setup. More info is in the docker-compose section.
To have a persistent storage for your datas, you may want to create volumes for your db, and for monica you will have to save the /var/www/html/storage
directory.
Run a container with this named volume:
docker run -d \
-v monica_data:/var/www/html/storage \
monica
Like every Laravel application, the php artisan
command is very usefull for Monica. To run a command inside the container, run
docker exec CONTAINER_ID php artisan COMMAND
or for docker-compose
docker-compose exec monica php artisan COMMAND
where monica
is the name of the service in your docker-compose.yml
file.
The Monica image will use environment variables to setup the application. See Monica documentation for common used variables you should setup.
See some examples of docker-compose possibilities in the example section.
This version will use the apache image and add a mysql container. The volumes are set to keep your data persistent. This setup provides no ssl encryption and is intended to run behind a proxy.
Make sure to pass in values for APP_KEY
variable before you run this setup.
-
Create a
docker-compose.yml
fileversion: "3.4" services: app: image: monica depends_on: - db ports: - 8080:80 environment: - APP_KEY= - DB_HOST=db - DB_USERNAME=monica - DB_PASSWORD=secret volumes: - data:/var/www/html/storage restart: always db: image: mysql:5.7 environment: - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_DATABASE=monica - MYSQL_USER=monica - MYSQL_PASSWORD=secret volumes: - mysql:/var/lib/mysql restart: always volumes: data: name: data mysql: name: mysql
-
Set a value for
APP_KEY
variable before you run this setup. It should be a random 32-character string. You can for instance copy and paste the output ofecho -n 'base64:'; openssl rand -base64 32
: -
Run
docker-compose up -d
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.
-
Run this command once:
docker-compose exec app php artisan setup:production
When using FPM image, you will need another container with a webserver to proxy http requests. In this example we use nginx with a basic container to do this.
-
Download
nginx.conf
andDockerfile
file for nginx image. An example can be found on theexample section
mkdir web curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/nginx.conf -o web/nginx.conf curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/Dockerfile -o web/Dockerfile
The
web
container image should be pre-build before each deploy with:docker-compose build
. -
Create a
docker-compose.yml
fileversion: "3.4" services: app: image: monica:fpm depends_on: - db environment: - APP_KEY= - DB_HOST=db - DB_USERNAME=monica - DB_PASSWORD=secret volumes: - data:/var/www/html/storage restart: always web: build: ./web ports: - 8080:80 depends_on: - app volumes: - data:/var/www/html/storage:ro restart: always db: image: mysql:5.7 environment: - MYSQL_RANDOM_ROOT_PASSWORD=true - MYSQL_DATABASE=monica - MYSQL_USER=monica - MYSQL_PASSWORD=secret volumes: - mysql:/var/lib/mysql restart: always volumes: data: name: data mysql: name: mysql
-
Set a value for
APP_KEY
variable before you run this setup. It should be a random 32-character string. You can for instance copy and paste the output ofecho -n 'base64:'; openssl rand -base64 32
: -
Run
docker-compose up -d
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.
-
Run this command once:
docker-compose exec app php artisan setup:production
To expose your Monica instance for the internet, it's important to set environment variable APP_ENV=production
. In this case https
mode will be mandatory.
One way to expose your Monica instance is to use a proxy webserver from your host with SSL capabilities. This is possible with a reverse proxy.
See some examples of docker-compose possibilities in the example section to show how to a proxy webserver with ssl capabilities.
The monica
images come in many flavors, each designed for a specific use case.
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
This image is based on the popular Alpine Linux project, available in the alpine
official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc instead of glibc and friends, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as git
or bash
) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the alpine
image description for examples of how to install packages if you are unfamiliar).
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in the repo-info
repository's monica/
directory.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.