Skip to content

Commit 958077d

Browse files
marcosnilsmilesbxf
authored andcommitted
Update Dockerfile.response
This reduces the final response image size from ~1gb to ~230mb by using the `slim` python image and removing unnecessary apt caching.
1 parent a6d55bb commit 958077d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

demo/Dockerfile.response

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM python:3.7
1+
FROM python:3.7-slim
22

3-
RUN apt-get update && apt-get install -y \
4-
netcat
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
netcat \
5+
&& rm -rf /var/lib/apt/lists/*
56

67
WORKDIR /app
78
COPY requirements.txt /app
@@ -10,4 +11,4 @@ RUN pip install -r requirements.txt
1011
COPY . /app/
1112

1213
ENTRYPOINT ["python", "manage.py"]
13-
CMD ["runserver", "0.0.0.0:8000"]
14+
CMD ["runserver", "0.0.0.0:8000"]

0 commit comments

Comments
 (0)