Skip to content

Commit

Permalink
feat: install deps using PEP 517 (#329)
Browse files Browse the repository at this point in the history
* feat: install deps using PEP 517

* fix: packaging of Dockerfile
  • Loading branch information
browniebroke authored Dec 12, 2022
1 parent 65ad1b4 commit 007630a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.flake8
.git
.gitignore
.github
.gitpod.yml
.pre-commit-config.yaml
action.yml
CHANGELOG.md
commitlint.config.json
renovate.json
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ FROM python:3.11-slim
# Create app directory
WORKDIR /app

# Install poetry & disable virtual environment
RUN pip install poetry && \
poetry config virtualenvs.create false
# Copy file containing dependencies
COPY . .

# Copy config files
COPY pyproject.toml poetry.lock ./

# Install only main dependencies
RUN poetry install --no-root --no-dev

# Copies source code
COPY src /app
# Install dependencies using PEP 517 Build Backend
RUN pip install .

# Run the app
ENTRYPOINT ["python", "/app/app.py"]
CMD ["python", "/app/src/app.py"]
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ classifiers = [
"Operating System :: OS Independent",
"Topic :: Software Development"
]
packages = [
{ include = "app.py", from = "src" },
]

[tool.poetry.dependencies]
python = "^3.8"
Expand Down

0 comments on commit 007630a

Please sign in to comment.