tcc/FlaskAPI/Dockerfile

37 lines
1.2 KiB
Docker
Raw Normal View History

ARG PYTHON_VERSION=3.10.12
FROM python:${PYTHON_VERSION}-slim as base
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
2023-11-04 03:41:12 +00:00
RUN apt-get update && \
2023-11-04 03:45:56 +00:00
apt-get install -y wget unzip && \
2023-11-04 03:41:12 +00:00
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.0/protoc-25.0-linux-x86_64.zip && \
unzip protoc-25.0-linux-x86_64.zip && \
mv bin/protoc /usr/local/bin/ && \
rm -rf protoc-25.0-linux-x86_64.zip bin include readme.txt
2024-01-16 00:03:44 +00:00
RUN wget https://files.ivanch.me/api/public/dl/ch3NV0P8/small-image.png && \
wget https://files.ivanch.me/api/public/dl/jNlXYMLR/big-image.png && \
wget https://files.ivanch.me/api/public/dl/QdKvaeQI/video.mp4 && \
wget https://files.ivanch.me/api/public/dl/YD4vmSsO/nginx.html && \
rm -rf runtimes && \
mkdir -p ./static && \
mv small-image.png ./static && \
mv big-image.png ./static && \
mv video.mp4 ./static && \
mv nginx.html ./static
2023-09-21 20:57:47 +00:00
COPY . .
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt
EXPOSE 5000
# Run the application.
2023-09-24 13:56:01 +00:00
CMD gunicorn 'app:app' --bind=0.0.0.0:5000 --timeout 3600