Files
Personal/docker/first-try/dockerfile.md
2026-04-09 00:04:07 +00:00

27 lines
939 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
```
# syntax=docker/dockerfile:1
FROM python:3.13-alpine AS builder
##выбрал 13-ый, так как уже собирал на нём
WORKDIR /test
## выбрал рабочей директоририей, директорию тест
COPY requirements.txt .
#Копируем необходимые зависимости
RUN pip install --no-cache-dir -r requirements.txt
#А теперь говорим питону их установить
### STAGE 2 ###
FROM python:3.13-alpine
WORKDIR /test
copy --from=builder /usr/local/lib/python3.13 /usr/local/lib/python3.13
copy --from=builder /test /test
COPY my_first.py .
#Копируем текущую директорию '.' в проект в директорию '.'
ENTRYPOINT ["python", "my_first.py"]
#Я выбрал ENTRYPOINT так как мне не нужно менять исполняемый файл по умолчанию
```