35 lines
716 B
Docker
35 lines
716 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
git \
|
|
openssh-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# ZP Wiki je do kontajnera pripájaná ako /zpwiki
|
|
RUN git config --system --add safe.directory /zpwiki
|
|
|
|
# CPU-only PyTorch.
|
|
RUN python -m pip install --no-cache-dir \
|
|
torch==2.11.0 \
|
|
--index-url https://download.pytorch.org/whl/cpu
|
|
|
|
COPY requirements.txt .
|
|
|
|
RUN python -m pip install --no-cache-dir \
|
|
-r requirements.txt
|
|
|
|
COPY app ./app
|
|
COPY scripts ./scripts
|
|
|
|
RUN mkdir -p data
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|