-
Notifications
You must be signed in to change notification settings - Fork 18
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
provide alternative start / stop commands #37
Comments
I'm unsure, this is starting to be complicated, when it's supposed to be a zero configuration tool. Yet, it could be nice to have containers started/killed automatically. Maybe we can detect Docker (with or without Compose), and start/kill the containers as necessary? in addition to the rackup, shell and port forwarding strategies. Or test and improve the shell script strategy to accept a I'm using Vagrant with either VirtualBox or LXC (depending on the guest OS) myself, and usually use the port forwarding feature only. The port forwarding could be improved to target an optional IP too, so we could avoid a port redirection. |
Well, the zero configuration variant for regular rackup applications should be still simple. If you try to detect docker containers, vm's etc things will be much more complicated and error prone. So you are currently starting and stopping the vagrant machines manually then or do you have "real" integration with prax? |
It's not integrated. I'm manually starting the Vagrant boxes, because I work in the Vagrant boxes anyway. This is where everything is installed, and where I run tests and a webserver. Actually, the following should already work, as long as you have a #! /usr/bin/env sh
docker-compose up
trap "docker-compose down" TERM
while true; do
sleep 20 &
wait $!
done The sleep/wait combo is meant to keep the shell script alive, so it can receive the prax_start() {
docker-compose up
}
prax_stop() {
docker-compose down
} Or for my own purposes: PID=/tmp/prax_rackup.pid
prax_start() {
vagrant up web
vagrant ssh web -c "cd /vagrant && rackup -b 0.0.0.0 -P $PID"
}
prax_stop() {
vagrant ssh web -c "[ -f $PID ] && kill `cat $PID`"
} |
If there would be a config file with ip, start and stop commands (plus the already provided port) it would be possible to support other projects as well.
Like docker containers, VMs etc.
I would love to see this feature although I understand that it might add more complexity as well.
A
myapp.yml
would be nice like:The text was updated successfully, but these errors were encountered: