File size: 735 Bytes
88d3747
 
 
51d6c3c
e9bc222
 
 
 
88d3747
 
3b9d224
88d3747
 
 
542f946
9c463b3
88d3747
 
 
 
 
66c066f
448f25c
9c463b3
88d3747
66c066f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 \
    HF_HUB_DISABLE_SYMLINKS_WARNING=1 \
    HF_HOME=/tmp/hf-cache \
    TRANSFORMERS_CACHE=/tmp/hf-cache \
    SENTENCE_TRANSFORMERS_HOME=/tmp/hf-cache \
    TORCH_HOME=/tmp/hf-cache

RUN apt-get update && apt-get install -y \
    build-essential wget git libglib2.0-0 libgl1 && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /code
ENV PYTHONPATH=/code

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . /code

# 書き込み可能に
RUN mkdir -p /code/data /tmp/hf-cache && chmod -R 777 /code/data /tmp/hf-cache

EXPOSE 7860
# ★ run.pyは使わず、起動ターゲットを固定
CMD ["uvicorn", "irpr.main:app", "--host", "0.0.0.0", "--port", "7860"]