Skip to content

Commit

Permalink
refactor(docker): update build to install pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Jul 7, 2023
1 parent 22216db commit 125f17d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 9 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM eligibility_server:latest

# install python tooling
COPY .devcontainer/requirements.txt .devcontainer/requirements.txt
RUN pip install --no-cache-dir -r .devcontainer/requirements.txt
# install devcontainer requirements
RUN pip install -e .[dev,test]

# install docs tooling
# docs requirements are in a separate file for the GitHub Action
COPY docs/requirements.txt docs/requirements.txt
RUN pip install --no-cache-dir -r docs/requirements.txt

# install test tooling
COPY tests/requirements.txt tests/requirements.txt
RUN pip install -r tests/requirements.txt
# install pre-commit environments in throwaway Git repository
# https://stackoverflow.com/a/68758943
COPY .pre-commit-config.yaml .
RUN git init . && \
pre-commit install-hooks && \
rm -rf .git
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ FROM ghcr.io/cal-itp/docker-python-web:main

ENV FLASK_APP=eligibility_server/app.py

# install python app dependencies
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# upgrade pip
RUN python -m pip install --upgrade pip

# copy source files
COPY bin/ bin/
COPY bin bin
COPY eligibility_server/ eligibility_server/
COPY *.py .
COPY README.md .
COPY pyproject.toml pyproject.toml

# install source as a package
RUN pip install -e .
Expand Down

0 comments on commit 125f17d

Please sign in to comment.