-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 901 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (24 loc) · 901 Bytes
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
29
30
31
# Dockerfile for FLUX.1 Quantized Inference
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y python3 python3-pip git
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# Add fastapi and uvicorn to the dependencies
RUN pip3 install --no-cache-dir --upgrade \
'diffusers[torch]@git+https://github.com/huggingface/diffusers.git@e8e44a510c152fff17e3f1bba036d635776b5b9f' \
transformers \
accelerate \
torchao \
sentencepiece \
protobuf \
fastapi \
python-multipart \
"uvicorn[standard]"
COPY main.py .
# Expose the port the API server will run on
EXPOSE 8000
# The CMD is now optional as the bat file specifies the command,
# but it's good practice to have a default.
CMD ["python3", "main.py"]