My current non-pants workflow involves running my ...
# general
l
My current non-pants workflow involves running my python server script in a docker container with the source code mapped to a volume on the container. File watchers will restart server script inside the docker container when I make code changes. Is there a way to support a similar workflow with pants where the server script is run inside the docker container and restarts on code changes? Is it reasonable to install pants inside of the docker image and run the server target with pants inside the docker container? Perhaps I'm not understanding something essential about pants because this feels a little hacky to me. Thanks in advance!
b
Pants inside a docker image can probably work (although file watching may not work for the mapped volumes, depending on the host system outside docker), or maybe letting pants run natively (and thus do native file watching) but invoke the commands in a docker “environment“: https://www.pantsbuild.org/docs/environments
👀 1
l
Remote docker execution environments looks like just what I need! Thank you @broad-processor-92400!
Are there any example repos with a docker environment set up?
b
I don’t know of one, sorry
l
@lemon-eye-70471 if you end up setting up a toy example, you could push it to your github, it would be a useful reference. I'll definitely pull and run it because I am curious about the same workflow.
1
l
Do docker_environments work with the
run
goal? So far I'm reading from the docs that docker_environments are used for the
package
goal and I'm getting the warning:
Copy code
The `run` goal was called with target `myapp:manage`, which specifies the environment `local_docker`, which is a `docker_environment`. The `run` goal only runs in the local environment. You may experience unexpected behavior.
I'm assuming that I'll need to use the run goal to accomplish the above workflow.