-
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
Conversation
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.
Thank you for your contribution @iloveitaly !
I would love to have a raspberry to test it ;)
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 | ||
MAIL_FROM_ADDRESS=[email protected] | ||
MAIL_FROM_NAME=Monica |
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 the docker-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.
cron: | ||
image: monica | ||
env_file: .env | ||
restart: always | ||
volumes: | ||
- data:/var/www/html/storage | ||
command: cron.sh | ||
depends_on: | ||
- db |
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.
We should not mix the example. Here it's for raspberry, and the cron
part is not mandatory, please remove it from the example.
cron: | |
image: monica | |
env_file: .env | |
restart: always | |
volumes: | |
- data:/var/www/html/storage | |
command: cron.sh | |
depends_on: | |
- db |
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.
I believe the cron
is mandatory: without it, reminder emails are not sent (and therefore the application setup isn't complete). Am I missing something here? Is there another way for reminders and other async jobs to run?
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.
@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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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?
I hope you can get one! They are really neat little machines. |
Co-authored-by: Alexis Saettler <[email protected]>
@iloveitaly I merged this one in the end, thank you! |
@iloveitaly that was genius idea to use another container for cron. Works flawlessly. I hated idea of building another image for supervisord. Thank you for contribution. Btw this works on any other machine, there is nothing that limits it to raspberry pi only. @asbiin String "raspberry pi" should be renamed to "apache with cron" in examples. |
No description provided.