-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding raspberrypi docker-compose example #49
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
APP_KEY=app_key | ||
APP_URL="raspberrypi.local:8080" | ||
DB_HOST=db | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=smtp.domain.com | ||
MAIL_PORT=587 | ||
MAIL_USERNAME=username | ||
MAIL_PASSWORD=password | ||
MAIL_ENCRYPTION=tls | ||
[email protected] | ||
MAIL_FROM_NAME=Monica | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,40 @@ | ||||||||||||||||||||
version: "3.4" | ||||||||||||||||||||
|
||||||||||||||||||||
services: | ||||||||||||||||||||
app: | ||||||||||||||||||||
image: monica | ||||||||||||||||||||
env_file: .env | ||||||||||||||||||||
depends_on: | ||||||||||||||||||||
- db | ||||||||||||||||||||
ports: | ||||||||||||||||||||
- 8080:80 | ||||||||||||||||||||
volumes: | ||||||||||||||||||||
- data:/var/www/html/storage | ||||||||||||||||||||
restart: always | ||||||||||||||||||||
|
||||||||||||||||||||
cron: | ||||||||||||||||||||
image: monica | ||||||||||||||||||||
env_file: .env | ||||||||||||||||||||
restart: always | ||||||||||||||||||||
volumes: | ||||||||||||||||||||
- data:/var/www/html/storage | ||||||||||||||||||||
command: cron.sh | ||||||||||||||||||||
depends_on: | ||||||||||||||||||||
- db | ||||||||||||||||||||
Comment on lines
+15
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not mix the example. Here it's for raspberry, and the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @asbiin friendly reminder on my question about async jobs running when cron is not in place. Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly I stumbled upon the same issue and was about to give the cron thing a try, but looking further it seems that the supervisor method is the way to go: https://github.com/monicahq/docker/blob/master/.examples/supervisor/fpm/docker-compose.yml and you need to copy the files from https://github.com/monicahq/docker/tree/master/.examples/supervisor/fpm/app as mentioned in the docs, once it was running with supervisor the reminder mails stared coming in as expected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lcx why is the supervisor method the way to go? Running cron in a separate container doesn't seem like a bad option, and has some benefits compared to the supervisor method (more configuration i docker vs lesser known unix tooling; easier monitoring and log analysis of separate processes; etc). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @asbiin the cron part is mandatory if you want reminder emails and other async jobs to be run, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iloveitaly indeed, the cron part is here to run the schedule command, which aims at sending reminders, and other tasks. It's not mandatory to run the application, that's why it's not included in all examples, also because there are multiple ways to handle it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I agree with @iloveitaly : the "normal" way do create cron part with docker is running another container, not using supervisor. Each container has its own purpose, and it's easier to start/stop only one without touching the others. Maybe it could be better to have a dedicated section about the cron/scheduler part - I would agree documentation is not the best part of this project! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @asbiin what are your thoughts about merging this in and handling the future improvements to documentation in a separate PR? Having this example in this repo would have been super helpful for me as I was trying to host this on my pi. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @asbiin friendly reminder on my last comment: thoughts on merging as-is and then tweaking later? |
||||||||||||||||||||
|
||||||||||||||||||||
db: | ||||||||||||||||||||
image: jsurf/rpi-mariadb:latest | ||||||||||||||||||||
environment: | ||||||||||||||||||||
MYSQL_ROOT_PASSWORD: secret | ||||||||||||||||||||
MYSQL_DATABASE: monica | ||||||||||||||||||||
MYSQL_USER: homestead | ||||||||||||||||||||
MYSQL_PASSWORD: secret | ||||||||||||||||||||
volumes: | ||||||||||||||||||||
- mysql:/var/lib/mysql | ||||||||||||||||||||
restart: always | ||||||||||||||||||||
|
||||||||||||||||||||
volumes: | ||||||||||||||||||||
data: | ||||||||||||||||||||
name: data | ||||||||||||||||||||
mysql: | ||||||||||||||||||||
name: mysql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand the value of having a
.env
file, in all examples I prefer to put everything in thedocker-compose.yml
file for simplicity.Appart from
DB_HOST
variable, all others will be env-specific, and should not be included (you should be able to get the example and run-it, the rest of the configuration is up to the person)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you ok including all of these variables in the
docker-compose.yml
? I found the exact variables required for the installation challenging to find and I think it would improve the dev UX if we include them directly in the example.