Is it possible to use this docker? "Monica" Relationships database/CRM.


Ruthalas

Recommended Posts

I recently cam across this Hacker News thread detailing a self-hosted CRM for relationships called Monica.

It would allow you to track various details of interpersonal relationships, from birthdays to gifts to debts.

I'd like to get it running, but the docker instructions include a lot of details about setting up an .env file.

 

I am not well versed in Docker, but I have managed to get one or two template-less dockers up and running.

None had this much extra configuration though.

 

Is this sort of setup feasible in the unRAID docker environment, and if so, how complex is getting that set up?

Link to comment
7 hours ago, tjb_altf4 said:

Search via CA in unRAID and extend search to docker hub.

The GitHub repository linked is for those wanting to build the image from scratch.

It looks like "monicahq" is the official docker hub repository for Monica CRM.

https://hub.docker.com/u/monicahq/

Thanks for the response.

 

The portion I am struggling with is how to implement the .env file portion of the quickstart guide:

Quickstart
Download a copy of MonicaHQ's example configuration file:

$ curl https://raw.githubusercontent.com/monicahq/monica/master/.env.example > .env

Edit it:

Set APP_KEY to a random 32-character string. For example, if you have the pwgen utility installed, you could copy and paste the output of pwgen -s 32 1.
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 set DB_PREFIX= and not DB_PREFIX='' as docker will not expand this as an empty string.
Run this image:

$ docker run --env-file .env -p 80:80 monicahq/monicahq

 

I can fetch the file and prepare it, but I'm not sure how to incporate the .env file into the creation of the docker in unRAID.

  • Where would I place the .env file such that the (as yet not created) docker can access it?
  • How do I replicate that final 'docker run' command in my unRAID docker interface?
Edited by Ruthalas
Code block had incorrect syntax highlighting.
  • Upvote 1
Link to comment

@Ruthalas

After looking further into this package I got interested and wanted it working too haha.

One method I knew would work was to add all variables to the docker template... no thanks 😛

Though some google-fu and trial and error, I eventually worked out how to pass the .env file and got monica running.

 

If you manually create the monicahq folder in appdata directory and add the .env file there, you can point to it in the Extra Parameters section of the docker template (advanced setting enabled) with this:

--env-file=/mnt/user/appdata/monicahq/.env

Other than adding port and the appdata path (probably needed later on) this is all that is needed to get the service going, but be warned it may need some further tweaking.

 

I've also setup monica's db in mariadb, if anyone is interested in how to set that up I'm happy to share.

  • Like 1
Link to comment

Assuming MariaDB is already up and running, bash into the docker container (or select console on the mariadb docker context window).

In the console enter the following command, if there's no password set on mariadb, press enter on password prompt.

mysql -u root -p

Once logged in run the following commands, modifying password and username fields as you require.

CREATE USER 'monicaUser' IDENTIFIED by 'monicaPassword';
CREATE DATABASE IF NOT EXISTS monicahq CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON monicahq.* TO 'monicaUser' IDENTIFIED BY 'monicaPassword';

Note the created values, these will need to be added to the database connection details in the .env file

 

I've also set up the collation (in the statement above) to allow for emoji data to be stored, we turn this setting on in Monica in the docker .env file by setting emoji usage to true

# Use utf8mb4 database charset format to support emoji characters
# ⚠ be sure your DBMS supports utf8mb4 format
DB_USE_UTF8MB4=true

 

  • Like 1
Link to comment

Ok! Question for you.

I spun up the database, made monicahq database, and spun up the docker.
When I launch the web interface I get the following error:

Whoops! Something went wrong.
The stream or file "/var/www/monica/storage/logs/laravel-2018-11-08.log" could not be opened: failed to open stream: Permission denied

Back to homepage

My docker config looks like this:

image.png.767a76541af16837c6581a04dfd7c442.png

 

And the Access Mode for the container path remap is "Read/Write". (I tried RW/Slave as well.)

(I figured manually creating the folder might be skewing the permissions, so I tried letting the unRAID docker setup create the directory, then placing the env file in, but that didn't change anything.)

Any guidance?

Link to comment
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.