File tree Expand file tree Collapse file tree 6 files changed +71
-10
lines changed
Expand file tree Collapse file tree 6 files changed +71
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,13 @@ RUN npm run compile
1111FROM python:3.13.5-alpine3.21 AS python_base
1212
1313ENV PYTHONDONTWRITEBYTECODE=1 \
14- PYTHONUNBUFFERED=1
14+ PYTHONUNBUFFERED=1 \
15+ VIRTUAL_ENV=/app/.venv \
16+ PATH="/app/.venv/bin:$PATH" \
17+ USER=app
18+
19+ RUN addgroup --gid 1000 --system ${USER} \
20+ && adduser --uid 1000 --system ${USER} --ingroup ${USER}
1521
1622FROM python_base AS builder
1723
@@ -26,15 +32,16 @@ COPY pyproject.toml poetry.lock ./
2632RUN pip install poetry
2733RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
2834
35+ FROM builder AS development
2936
30- FROM python_base
37+ RUN poetry install
3138
32- ENV VIRTUAL_ENV=/app/.venv \
33- PATH="/app/.venv/bin:$PATH" \
34- USER=app
39+ USER ${USER}
40+ WORKDIR /app
3541
36- RUN addgroup --gid 1000 --system ${USER} \
37- && adduser --uid 1000 --system ${USER} --ingroup ${USER}
42+ COPY --chown=${USER}:${USER} . .
43+
44+ FROM python_base
3845
3946USER ${USER}
4047WORKDIR /app
Original file line number Diff line number Diff line change 22
33services :
44 web :
5- build : .
5+ build :
6+ context : .
7+ dockerfile : Dockerfile
8+ target : development
69 command : python manage.py runserver 0.0.0.0:8000
710 ports :
811 - " 8000:8000"
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ dependencies = [
1616[tool .poetry ]
1717package-mode = false
1818
19+ [tool .poetry .group .dev .dependencies ]
20+ ruff = " ^0.12.5"
21+
1922[build-system ]
2023requires = [" poetry-core>=2.0.0,<3.0.0" ]
2124build-backend = " poetry.core.masonry.api"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ cd " $( git rev-parse --show-toplevel) "
6+
7+ # This file is for you! Edit it to call your unit test suite. Note that the same
8+ # file will be called if you run it locally as if you run it on CI.
9+
10+ # Replace the following line with something like:
11+ #
12+ # rubocop
13+ # python manage.py lint
14+ # npm run lint
15+ #
16+ # or whatever is appropriate to your project. You should *only* run your fast
17+ # tests from here. If you want to run other test suites, see the predefined
18+ # tasks in scripts/lint.mk.
19+
20+ docker compose run --rm web poetry run ruff check lung_cancer_screening
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ cd "$(git rev-parse --show-toplevel)"
1717# tests from here. If you want to run other test suites, see the predefined
1818# tasks in scripts/test.mk.
1919
20- docker compose run web python manage.py test
20+ docker compose run web poetry run python manage.py test
You can’t perform that action at this time.
0 commit comments