Rightlight / Dockerfile
mike23415's picture
Update Dockerfile
2eb47b3 verified
raw
history blame
660 Bytes
FROM python:3.9-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
git \
libpng-dev \
libjpeg-dev \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
chmod -R 777 /tmp
COPY requirements.txt .
RUN python -m pip install --upgrade pip && \
python -m pip install --no-cache-dir -r requirements.txt -v
COPY app.py .
# Set Hugging Face token as environment variable
# Replace <your_hf_token> with your actual token
ENV HF_TOKEN=<your_hf_token>
ENV HF_HOME=/tmp/hf_home
ENV XDG_CACHE_HOME=/tmp/cache
EXPOSE 7860
CMD ["python", "app.py"]