Skip to content

Commit

Permalink
switch to pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
abachleda-baca committed Oct 18, 2024
1 parent 910570a commit eab47d9
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 16 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
with:
python-version: "3.11"
cache: "pip"
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Install Pipenv
run: pip install pipenv
- name: Verify Pipfile.lock is in sync
run: pipenv verify
- name: Install dependencies
run: pipenv install --dev
- name: Run Unit Tests
run: python -m pytest -v
run: pipenv run tests
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PIP_ROOT_USER_ACTION=ignore

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN addgroup -S appgroup && adduser -S appuser -G appgroup -u 80

RUN \
apk add \
Expand All @@ -16,8 +16,13 @@ RUN \
build-base

COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock

# Install deps and run build
RUN pip3 install --no-cache-dir pipenv \
&& pipenv install --system --deploy --ignore-pipfile

USER 80
EXPOSE 5000
CMD ["flask", "run", "--host", "0.0.0.0"]
CMD ["pipenv", "run", "flask", "run", "--host", "0.0.0.0"]
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
flask-sqlalchemy = "*"
flask-cors = "*"
govuk-frontend-jinja = "*"
jinja2 = "~=3.1.2"
psycopg2-binary = "*"
alembic = "*"
boto3 = "*"
pytest = "*"
coverage = "*"

[dev-packages]

[requires]
python_version = "3.12"
Loading

0 comments on commit eab47d9

Please sign in to comment.