Closed harobed closed 8 years ago
The exec provided would work if it were within a web node, instead of the build node, like this:
build:
runtime: python27
web1:
exec: "./env/bin/python app.py"
You can find more information here: https://docs.nanobox.io/boxfile/code-services/web/
Thanks!
Actually, I think the more proper way to accomplish this would be to use the python engine's "app_module" configuration. More information can be found here: https://engines.nanobox.io/releases/00d59bc3-7943-4082-97b8-44be36055f4b#app_module
... web1: exec: "./env/bin/python app.py
Ok, I'm going to test it.
I've updated https://github.com/harobed/nanobox-python-sample/blob/master/Boxfile I execute :
$ nanobox destroy
$ nanobox run
$
...
+> Copying release into live code directory...
+> Moving final build into release environment...
+> Launching Code services
- Creating web1 container
- Starting web1 service
--------------------------------------------------------------------------------
[√] APP SUCCESSFULLY BUILT /// DEV URL : test_nanobox.dev
--------------------------------------------------------------------------------
++> STREAMING LOGS (ctrl-c to exit) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Next, in another term I run :
$ nanobox dev
[gonano@test_nanobox /code]$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
gonano 1 0.0 0.0 4348 632 ? Ss+ 11:34 0:00 /bin/sleep 365d
gonano 37 0.0 0.3 18160 3220 ? Ss 11:34 0:00 /bin/bash
gonano 50 0.0 0.2 15572 2180 ? R+ 11:34 0:00 ps aux
I don't see my python app.
It's a bug ?
This is an area where nanobox could do a better job of setting a clear expectation. When you issue the 'nanobox run' command, nanobox will run all of the components and services of your app within docker containers, matching the label (if provided) in the Boxfile. 'nanobox dev' will launch a dev1 docker container with some different behaviors.
In your case, the web service containing the python process will be running in the web1 container, and not in the dev1 container where 'nanobox dev' drops you. If you would like to console into the web1 container and see the python process running, you can do so with the 'console' subcommand, like this:
nanobox console web1
I'm curious to see what you find!
Thanks
What I do :
I got :
My execution command specify here : https://github.com/harobed/nanobox-python-sample/blob/master/Boxfile#L3 isn't executed.
Other note : the nanobox output say nothing about line executed.