Dockerfile 673 B

12345678910111213141516171819202122232425262728
  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. COPY pyproject.toml poetry.lock ./
  9. RUN poetry source add --priority=primary tsinghua https://pypi.tuna.tsinghua.edu.cn/simple || true \
  10. && poetry lock \
  11. && poetry install --no-root --no-interaction --no-ansi
  12. COPY . .
  13. ARG APP_ENV=dev
  14. ENV APP_ENV=${APP_ENV}
  15. ARG STORE_PORT=8001
  16. ENV STORE_PORT=${STORE_PORT}
  17. EXPOSE ${STORE_PORT}
  18. CMD ["sh", "-c", "uvicorn alien_store.main:app --host 0.0.0.0 --port ${STORE_PORT}"]