Dockerfile 1004 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
  2. ENV HOME=/app/aphrodite-engine
  3. WORKDIR $HOME
  4. # Upgrade OS Packages + Prepare Python Environment
  5. RUN set -eux; \
  6. export DEBIAN_FRONTEND=noninteractive \
  7. && apt-get update \
  8. && apt-get upgrade -y \
  9. && apt-get install -y bzip2 g++ git make python3-pip tzdata \
  10. && rm -fr /var/lib/apt/lists/*
  11. # Alias python3 to python
  12. RUN ln -s /usr/bin/python3 /usr/bin/python
  13. RUN python3 -m pip install --no-cache-dir --upgrade pip
  14. RUN git clone https://github.com/PygmalionAI/aphrodite-engine.git /tmp/aphrodite-engine \
  15. && mv /tmp/aphrodite-engine/* . \
  16. && rm -fr /tmp/aphrodite-engine \
  17. && chmod +x docker/entrypoint.sh
  18. # Export the CUDA_HOME variable correctly
  19. ENV CUDA_HOME=/usr/local/cuda
  20. ENV HF_HOME=/tmp
  21. RUN python3 -m pip install --no-cache-dir -e .
  22. # Entrypoint exec form doesn't do variable substitution automatically ($HOME)
  23. ENTRYPOINT ["/app/aphrodite-engine/docker/entrypoint.sh"]
  24. EXPOSE 5000
  25. USER 1000:0
  26. VOLUME ["/tmp"]