mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
fix(content): align compose demo Dockerfiles to COPY over ADD
The app and django compose demos used ADD for plain local files, but the book's in-text versions of the same examples (11.3_usage.md, 11.6_django.md) and its own guidance (7.2/7.3, appendix best_practices) all use COPY. Align the demos with the documented practice.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
FROM python:3.12-alpine
|
FROM python:3.12-alpine
|
||||||
ADD . /code
|
COPY . /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
RUN pip install redis flask
|
RUN pip install redis flask
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ FROM python:3
|
|||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
RUN mkdir /code
|
RUN mkdir /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
ADD requirements.txt /code/
|
COPY requirements.txt /code/
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
ADD . /code/
|
COPY . /code/
|
||||||
|
|||||||
Reference in New Issue
Block a user