· 5 years ago · Jul 30, 2020, 04:12 AM
1Attempting to set up MonicaHQ Docker container, but this really boils down to me trying to better learn and understand how to connect Docker containers with MySQL and to understand the whole process better.
2
3I'm installing this on a Raspberry Pi 4 running Raspbian on my local network.
4
5---
6
7MonicaHQ .env file (located at /env-files/monicahq/.env)
8
9# Two choices: local|production. Use local if you want to install Monica as a
10# development version. Use production otherwise.
11APP_ENV=production
12
13# true if you want to show debug information on errors. For production, put this
14# to false.
15APP_DEBUG=false
16
17# The encryption key. This is the most important part of the application. Keep
18# this secure otherwise, everyone will be able to access your application.
19# Must be 32 characters long exactly.
20# Use `php artisan key:generate` or `pwgen -s 32 1` to generate a random key.
21APP_KEY=aBase64KeyIGeneratedFromAWebsiteThatDoesThis
22# APP_KEY=ChangeMeBy32KeyLengthOrGenerated
23
24# Prevent information leakage by referring to IDs with hashIds instead of
25# the actual IDs used in the database.
26HASH_SALT=aRandomStringIGeneratedFromThatSameWebsite
27# HASH_SALT=ChangeMeBy20+KeyLength
28HASH_LENGTH=18
29
30# The URL of your application.
31APP_URL=http://localhost/monica
32
33# Database information
34# To keep this information secure, we urge you to change the default password
35DB_CONNECTION=mysql
36# ^^Using MariaDB^^
37# DB_HOST=127.0.0.1
38# DB_PORT=3306
39# You can use mysql unix socket if available, it overrides DB_HOST and DB_PORT values.
40DB_UNIX_SOCKET=/run/mysqld/mysqld.sock
41DB_DATABASE=monicahq
42DB_USERNAME=theDbUserICreatedInWebmin
43DB_PASSWORD=theMariaDbPasswordIChoseForThisUser
44DB_PREFIX=
45DB_TEST_HOST=
46DB_TEST_DATABASE=
47DB_TEST_USERNAME=
48DB_TEST_PASSWORD=
49
50# Use utf8mb4 database charset format to support emoji characters
51# ⚠ be sure your DBMS supports utf8mb4 format
52DB_USE_UTF8MB4=true
53
54# Mail credentials used to send emails from the application.
55# MAIL_DRIVER=smtp
56# MAIL_HOST=mailtrap.io
57# MAIL_PORT=2525
58# MAIL_USERNAME=
59# MAIL_PASSWORD=
60# MAIL_ENCRYPTION=
61# Outgoing emails will be sent with these identity
62# MAIL_FROM_ADDRESS=
63# MAIL_FROM_NAME="Monica instance"
64# New registration notification sent to this email
65# APP_EMAIL_NEW_USERS_NOTIFICATION=
66
67# Ability to disable signups on your instance.
68# Can be true or false. Default to false.
69APP_DISABLE_SIGNUP=true
70
71# Enable user email verification.
72APP_SIGNUP_DOUBLE_OPTIN=true
73
74# Set trusted proxy IP addresses.
75# To trust all proxies that connect directly to your server, use a "*".
76# To trust one or more specific proxies that connect directly to your server,
77# use a comma separated list of IP addresses.
78APP_TRUSTED_PROXIES=
79
80# Enable automatic cloudflare trusted proxy discover
81APP_TRUSTED_CLOUDFLARE=true
82
83# Frequency of creation of new log files. Logs are written when an error occurs.
84# Refer to config/logging.php for the possible values.
85LOG_CHANNEL=daily
86
87# Error tracking. Specific to hosted version on .com. You probably don't need
88# those.
89# SENTRY_SUPPORT=false
90# SENTRY_LARAVEL_DSN=
91
92# Send a daily ping to https://version.monicahq.com to check if a new version
93# is available. When a new version is detected, you will have a message in the
94# UI, as well as the release notes for the new changes. Can be true or false.
95# Default to true.
96CHECK_VERSION=true
97
98# Cache, session, and queue parameters
99# ⚠ Change this only if you know what you are doing
100#. Cache: database, file, memcached, redis, dynamodb
101#. Session: file, cookie, database, apc, memcached, redis, array
102#. Queue: sync, database, beanstalkd, sqs, redis
103# If Queue is not set to 'sync', you'll have to set a queue worker
104# See https://laravel.com/docs/5.7/queues#running-the-queue-worker
105CACHE_DRIVER=database
106SESSION_DRIVER=file
107SESSION_LIFETIME=120
108QUEUE_CONNECTION=sync
109
110# If you use redis, set the redis host or ip, like:
111# REDIS_HOST=redis
112
113# Maximum allowed size for uploaded files, in kilobytes.
114# Make sure this is an integer, without commas or spaces.
115DEFAULT_MAX_UPLOAD_SIZE=102400
116
117# Maximum allowed storage size per account, in megabytes.
118# Make sure this is an integer, without commas or spaces.
119DEFAULT_MAX_STORAGE_SIZE=5120
120
121# Default filesystem to store uploaded files.
122# Possible values: public|s3
123DEFAULT_FILESYSTEM=public
124
125# AWS keys for S3 when using this storage method
126# AWS_KEY=
127# AWS_SECRET=
128# AWS_REGION=us-east-1
129# AWS_BUCKET=
130# AWS_SERVER=
131# Allow Two Factor Authentication feature on your instance
132MFA_ENABLED=true
133
134# Enable DAV support
135DAV_ENABLED=true
136
137# CLIENT ID and SECRET used for the official mobile application
138# This is to make sure that only the mobile application that you approve can
139# access the route to let your users sign in with their credentials
140# Note: the official mobile application is not currently available on the stores.
141# MOBILE_CLIENT_ID=
142# MOBILE_CLIENT_SECRET=
143
144# Allow to access general statistics about your instance through a public API
145# call
146ALLOW_STATISTICS_THROUGH_PUBLIC_API_ACCESS=false
147
148# Indicates that each user in the instance must comply to international policies
149# like CASL or GDPR
150POLICY_COMPLIANT=false
151
152# Enable geolocation services
153# This is used to translate addresses to GPS coordinates.
154ENABLE_GEOLOCATION=false
155
156# API key for geolocation services
157# We use LocationIQ (https://locationiq.com/) to translate addresses to
158# latitude/longitude coordinates. We could use Google instead but we don't
159# want to give anything to Google, ever.
160# LocationIQ offers 10,000 free requests per day.
161# LOCATION_IQ_API_KEY=
162
163# Enable weather on contact profile page
164# Weather can only be fetched if we know longitude/latitude - this is why
165# you also need to activate the geolocation service above to make it work
166# ENABLE_WEATHER=false
167
168# Access to weather data from darksky api
169# https://darksky.net/dev/register
170# Darksky provides an api with 1000 free API calls per day
171# You need to enable the weather above if you provide an API key here.
172# DARKSKY_API_KEY=
173
174---
175
176In MariaDB (set up via Webmin, installed on host system):
177* Created database = "monicahq"
178* Created user = "theDbUserICreatedInWebmin"
179* Set the password that I listed in the .env file
180* Set "theDbUserICreatedInWebmin" database permissions to "all" for user "theDbUserICreatedInWebmin" in the "monicahq" database
181* MySQL socket is set to: /run/mysqld/mysqld.sock
182* MySQL database files directory (datadir): /var/lib/mysql
183* Listening port: 127.0.0.1
184* Port 3306
185
186---
187
188From the CLI:
189
190docker run --name=monica \
191 --env-file=/env-files/monicahq/.env \
192 -e FIRST_USER=your@email.com \
193 -p 81:80 \
194 -v /var/lib/mysql/monicahq:/var/www/storage \
195 -d jc5x/monica-multi-arch
196
197(--env-file // is the actual location from root where I decided to store the .env file)
198(-p // I choice port 81 because Heimdall is on port 80)
199(-v // is the actual location on my Rpi where the MariaDB database exists : and the default location used by JC5/monica-multi-arch)
200
201---
202
203Btw, if anyone else comes across this and sees my mistakes, and willing to point them out to me, I'm on freenode IRC in the #Docker chat @WyZeGuY. Thank you.