Skip to content

Commit 119b781

Browse files
committed
refactor Dockerfile to use requirements.txt for Python package installation
1 parent ed425b3 commit 119b781

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Dockerfile

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,10 @@ RUN apt update && \
243243
groupadd docker
244244
245245
246-
# Install Python packages
247-
RUN pip3 install --no-cache-dir \
248-
autopep8 \
249-
cachelib \
250-
"check50<4" \
251-
cli50 \
252-
compare50 \
253-
cs50==9.4.0 \
254-
Flask \
255-
Flask-Session \
256-
help50 \
257-
pytest \
258-
render50 \
259-
setuptools \
260-
"style50>2.10.0" \
261-
"submit50<4"
246+
# Copy requirements file and install Python packages
247+
COPY requirements.txt /tmp/requirements.txt
248+
RUN pip3 install --no-cache-dir --requirement /tmp/requirements.txt && \
249+
rm /tmp/requirements.txt
262250
263251
264252
# Copy files to image

requirements.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
autopep8==2.3.2
2+
cachelib==0.13.0
3+
check50==3.4.0
4+
cli50==8.0.1
5+
compare50==1.2.13
6+
cs50==9.4.0
7+
Flask==3.1.1
8+
Flask-Session==0.8.0
9+
help50==3.0.5
10+
pytest==8.4.1
11+
render50==9.2.10
12+
setuptools==80.9.0
13+
style50==2.10.4
14+
submit50==3.2.1

0 commit comments

Comments
 (0)