Add Docker build and deploy pipeline
All checks were successful
deploy-ai / deploy (push) Successful in 2m56s
All checks were successful
deploy-ai / deploy (push) Successful in 2m56s
This commit is contained in:
22
ai-moderation/Dockerfile
Normal file
22
ai-moderation/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM python:3.12-slim
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
WORKDIR /app
|
||||
|
||||
# torch ставим отдельно в облегчённой версии для процессора (без CUDA)
|
||||
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY app ./app
|
||||
|
||||
RUN useradd -r -u 1001 app \
|
||||
&& mkdir -p /models \
|
||||
&& chown app /models
|
||||
USER app
|
||||
|
||||
ENV MODEL_CACHE_DIR=/models
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user