-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dockerfile): improve documentation and change working directory (#4)
- Installs code at /home/speckle to prevent collisions with files & directories in the root (/) directory - Updates the README and provides instructions for building and testing the docker image locally - Updated inline documentation in Dockerfile
- Loading branch information
1 parent
522ce59
commit 2b8bbd6
Showing
2 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
# We use the official Python 3.11 image as our base image and will add our code to it. For more details, see https://hub.docker.com/_/python | ||
FROM python:3.11-slim | ||
|
||
# We install poetry to generate a list of dependencies which will be required by our application | ||
RUN pip install poetry | ||
|
||
COPY . . | ||
RUN poetry export -f requirements.txt --output requirements.txt && pip install -r requirements.txt | ||
# We set the working directory to be the /home/speckle directory; all of our files will be copied here. | ||
WORKDIR /home/speckle | ||
|
||
# Copy all of our code and assets from the local directory into the /home/speckle directory of the container. | ||
# We also ensure that the user 'speckle' owns these files, so it can access them | ||
# This assumes that the Dockerfile is in the same directory as the rest of the code | ||
COPY . /home/speckle | ||
|
||
# Using poetry, we generate a list of requirements, save them to requirements.txt, and then use pip to install them | ||
RUN poetry export --format requirements.txt --output /home/speckle/requirements.txt && pip install --requirement /home/speckle/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters