jree423/diffsketcher
040
1FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime2 3# Set working directory4WORKDIR /code5 6# Install system dependencies7RUN apt-get update && apt-get install -y \8 build-essential \9 python3-dev \10 git \11 cmake \12 libcairo2-dev \13 pkg-config \14 && rm -rf /var/lib/apt/lists/*15 16# Install Python dependencies17RUN pip install --no-cache-dir \18 fastapi==0.95.2 \19 uvicorn==0.22.0 \20 Pillow==9.5.0 \21 cairosvg==2.7.0 \22 numpy==1.24.3 \23 requests==2.31.0 \24 git+https://github.com/openai/CLIP.git25 26# Install diffvg27RUN git clone https://github.com/BachiLi/diffvg.git && \28 cd diffvg && \29 git submodule update --init --recursive && \30 python setup.py install31 32# Copy the model files33COPY . /code/34 35# Create a directory for model weights36RUN mkdir -p /code/model_weights37 38# Set environment variables39ENV MODEL_DIR=/code/model_weights40ENV PYTHONPATH=/code41 42# Expose the port43EXPOSE 800044 45# Start the API server46CMD ["python", "api.py"]