Hey! I had a had a question about packaging up a P...
# sst
m
Hey! I had a had a question about packaging up a Python function. It tries to install a local repository, but it’s having issues during the Docker installation step. The example
srcPath
is a follows:
Copy code
handler.py
private-repo
poetry.lock
pyproject.toml
Where
poetry.lock
and
pyproject.toml
install
private-repo
directly. The issue I’m having is with this line: ([GitHub link](https://github.com/serverless-stack/serverless-stack/blob/2328bf3a5f938c9c448d9af5[…]8edded/packages/resources/assets/python/Dockerfile.dependencies))
Copy code
COPY Pipfile* pyproject* poetry* requirements.tx[t] ./
Where only a small set of files are copied to
/var/dependencies
. This causes the error below because custom directories aren’t copied over.
Copy code
#12 [8/9] RUN if [ -f 'poetry.lock' ]; then poetry export --with-credentials --format requirements.txt --output requirements.txt; else echo "poetry.lock not found"; fi
#12 sha256:729124a64255fd9df11c3256c2f02b195d0f5f7e798150b1579970bce9eccd3b
#12 0.402 
#12 0.402   ValueError
#12 0.402 
#12 0.402   Directory private-repo does not exist
The question I had was 1. if there’s any way to customize this Dockerfile so I can also specify to copy over
private-repo
so the dependencies are installed properly? 🤔 Thanks a lot in advance!
f
Hey @Mitchell Mohorovich, good point! We do have a Dockerfile where you can customize the install command. But it doesn’t let you modify the Dockerfile itself.
Let me take a look and get back to you on this.