Dockerfile: two-stage copy

This commit is contained in:
Yishuai Li 2023-04-11 17:25:30 +08:00
parent 225c731589
commit fe7b2d763b
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -5,9 +5,10 @@ RUN echo '[global]' > /etc/pip.conf && \
echo 'trusted-host = mirrors.aliyun.com' >> /etc/pip.conf echo 'trusted-host = mirrors.aliyun.com' >> /etc/pip.conf
COPY . /gpt
WORKDIR /gpt WORKDIR /gpt
COPY requirements.txt .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
COPY . .
CMD ["python3", "-u", "main.py"] CMD ["python3", "-u", "main.py"]