I am having an issue with a docker build using Pan...
# general
b
I am having an issue with a docker build using Pants. The dockerfile depends on a file named
.env
- When inspecting the sandbox, I notice Pants is not copying the
.env
file. I there a way for force this copy, my application depends on it, and I would like to avoid renaming the file - as there are other apps depending on this
c
you need a target to include that file, like
file(name="env-file", source=".env")
and then your docker image needs to pull that in with:
docker_image(.., dependencies=[":env-file"])
then it will exist in your docker build context. Adjust names etc as needed.
1
h
@billowy-crowd-24646 did this work?
b
I ended up going with - pants_ignore.add = [“!.env”]
from the pants.toml, as it was a dependency in multiple places
h
Huh, so the issue was that .env is in your gitignore?