-
Notifications
You must be signed in to change notification settings - Fork 280
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
Include startup actions like "migrate" #36
Comments
We're actually looking to create an AMI image, that we could sell on the Marketplace, cachethq/cachet#1324 — with no experience in doing this, is it something you could help out with? |
@jbrooksuk The AMI is a good idea, but it don't solve this problem here. |
I made a little bit research about the execution of the commands. Here is a small update:
If this command can be executed several times depends on the individual app.
This command generates the key for hashing secret information (like passwords) in Laravel.
Can be run every time. Only a "cache" will be updated. See https://laravel.com/docs/5.0/configuration#configuration-caching |
Another update:
|
I created a PR for this. You can start the image like:
In the first run the log looks like:
In the second run the log looks like:
|
Looks like there is a different method for this per #39 (comment) |
I posted a little bit more detailed question to #39. Waiting for feedback. |
Looks like we need to wait for upstream docs to be updated at this point. |
Yep, because i don |
For new installations it should be |
Well, basically just don't make any assumptions about needing to run migration commands when we don't ask you to in the docs, and you'll be ok. |
@GrahamCampbell true. |
I am a big fan of this. Anyone who wants to use any sort of automation to deploy this docker image will need this. +1 |
@andygrunwald anything within |
I've updated the documentation to show the |
Thanks @jbrooksuk I still need to run a |
Seeing that these environment variables are completely optional, I think it would be awesome to include them as they would help new users like myself getting started. It's awesome to get Cachet up and running with a single command. Also, as @jessesanford said, it makes automation much easier. This would enable Docker Swarm and Marathon deploy support out of the box. 👍 |
If you use the Cachet Docker image you fire the image up (via
run
).If you own an empty database (e.g. MySQL) you need to fire three more commands manually:
This is describes in the Get started with Docker.
This is fine when you run Cachet on your local machine or a dedicated docker host.
But if you want to run Cachet on a resource scheduler like Mesos (e.g. Marathon) you are not able to execute those commands by hand.
As a further advantage: With such a change it is much more easier to run Cachet on AWS Elastic Beanstalk (see #13) or AWS Elastic Container Engine.
The challenge is here (and this is an important information to keep in mind):
On such scheduler a node can go down. When this happen your container (Cachet) will be rescheduled and booted up again at another node. In such a case the commands will be executed again (with the same database config). So these commands need to be idempotent and it have to be non dangerous to run them in a production env at every time (when we run the same cachet version).
My proposal here is to include those three commands into the entrypoint.sh after the
composer install
.Lets get into detail for the single commands (i am not so fimilar with Laravel, so please correct me if i am wrong):
This is the command to boot up the initial database structure or migrate form an older cachet version to a newer one. According to Database: Migrations the
--force
flag is there to avoid a manual user interaction ( a prompt) for destructive operations that can cause data loss. Do we get those operations in Cachet?Or can we run those commands every time?
This command will generate a new encryption key for the database encryption. Correct?
So this command is not idempotent and i read a note in the documentation that you should generate a new key once you generated one. But is this the same as the env var
APP_KEY
(from entrypoint.sh)? If yes, we only execute this command if the env varAPP_KEY
is not set.This generates the config cache. Seems to be idempotent.
So this is fine to execute at every time.
I would like to get your opinion.
In the end this makes the usage of Cachet in a Docker env much more easier, because you skip the manual steps. Further more it enables you to uns runs on Mesos or AWS easier (and enables maybe more users).
If you agree with me i would create a PR for this. And i offer my help to run this on Mesos and / or AWS (my goal is it to un on Mesos).
The text was updated successfully, but these errors were encountered: