这是 Dockerfile,我在第 18 行收到错误,即 ARG DEV =false,我创建了一个 requests.dev.txt 文件,因此这些依赖项不应在生产中执行,而只能在开发中执行。
我在 .yml 文件中将该文件重写为 true。
Dockerfile:
# Install Python 3.9 image
FROM python:3.9-alpine3.13
# maintainer of the image
LABEL maintainer="tenz8"
# for faster response
ENV PYTHONBUFFERED 1
COPY ./requirements.txt /tmp/requirements.txt
COPY ./requirements.dev.txt /tmp/requirements.dev.txt
COPY ./app /app
WORKDIR /app
EXPOSE 8000
#getting overrided in decker-compose.yml
ARG DEV = false
# &&/ used to create new lines for lighter dockerfile
RUN python -m venv /py && \
/py/bin/pip install --upgrade pip && \
/py/bin/pip …Run Code Online (Sandbox Code Playgroud)