Dockerfile 663 B

123456789101112131415161718192021222324
  1. FROM python:3.12-slim
  2. WORKDIR /app
  3. ENV POETRY_VIRTUALENVS_CREATE=false \
  4. PYTHONUNBUFFERED=1 \
  5. PYTHONDONTWRITEBYTECODE=1
  6. RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
  7. && pip install --no-cache-dir poetry \
  8. -i https://pypi.tuna.tsinghua.edu.cn/simple \
  9. --trusted-host pypi.tuna.tsinghua.edu.cn
  10. COPY pyproject.toml poetry.lock ./
  11. RUN poetry source add --priority=primary tsinghua https://pypi.tuna.tsinghua.edu.cn/simple || true \
  12. && poetry lock \
  13. && poetry install --no-root --no-interaction --no-ansi
  14. COPY . .
  15. EXPOSE 38001
  16. CMD ["uvicorn", "alien_store.main:app", "--host", "0.0.0.0", "--port", "38001"]