Skip to content

Commit 0ce2c11

Browse files
BethanyGIsaacG
andauthored
[Dockerfile and dockerignore]: Slimmed Down Container Image & Upgraded to python 3.13.13 (#83)
* Changed base to python3.13-alpine3.23 and modified dockerfile and dockerignore to make image smaller. * Changed CI workflow to use run-tests-in-docker.sh. * Update Dockerfile Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com> --------- Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
1 parent 6e39b8e commit 0ce2c11

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

.dockerignore

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
!bin/run.py
2+
!bin/run.sh
3+
*.pyc
4+
*.pyd
5+
*.pyo
16
.appends
7+
.dockerignore
28
.git
9+
.gitattributes
310
.github
411
.gitignore
5-
.gitattributes
6-
.dockerignore
712
Dockerfile
13+
__pycache__
14+
bin/run-in-docker.sh
15+
bin/run-tests-in-docker.sh
16+
test/
17+
venv/
18+
19+

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ jobs:
2525
- name: Build Docker Image
2626
run: docker build -f Dockerfile -t python-analyzer .
2727

28-
- name: Run Tests
29-
run: docker run --entrypoint "pytest" python-analyzer
28+
- name: Run Tests for Analyzer in Docker
29+
run: bin/run-tests-in-docker.sh

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
FROM python:3.13.5-alpine3.22
1+
FROM python:3.13-alpine3.23
22

33
COPY requirements.txt /requirements.txt
4-
COPY dev-requirements.txt /dev-requirements.txt
54

6-
RUN pip install -r /requirements.txt -r /dev-requirements.txt
5+
RUN apk update && apk upgrade \
6+
&& apk --no-cache add bash \
7+
&& apk cache clean
8+
9+
RUN --mount=type=cache,target=/root/.cache/pip \
10+
PYTHONDONTWRITEBYTECODE=1 \
11+
pip install --no-compile --no-cache \
12+
-r /requirements.txt
713

814
COPY . /opt/analyzer
915

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
pylint ~=4.0.4
2+
pytest-subtests~=0.14.2
3+
pytest~=8.4.0

0 commit comments

Comments
 (0)