Dockerfile 893 B

12345678910111213141516171819202122232425262728293031
  1. FROM python:3.10-slim AS base
  2. LABEL maintainer="xujiawei@cocorobo.cc"
  3. RUN apt-get update \
  4. && apt-get install -y --no-install-recommends bash curl wget vim libmagic-dev \
  5. && apt-get autoremove \
  6. && rm -rf /var/lib/apt/lists/*
  7. RUN pip install --no-cache-dir poetry -i https://pypi.tuna.tsinghua.edu.cn/simple \
  8. && poetry config virtualenvs.create false
  9. COPY poetry.lock /env/poetry.lock
  10. COPY pyproject.toml /env/pyproject.toml
  11. RUN poetry config repositories.pypi https://pypi.tuna.tsinghua.edu.cn/simple
  12. #RUN cd /env && poetry lock --no-update && poetry install --only main
  13. RUN cd /env && poetry lock --no-update && poetry install --only main
  14. RUN pip install openai==1.27.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
  15. EXPOSE 8086
  16. WORKDIR /app
  17. COPY . /app
  18. COPY docker/entrypoint.sh /entrypoint.sh
  19. RUN chmod +x /entrypoint.sh
  20. ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]