working FastAPI in docker
This commit is contained in:
1 parent
38d4daa63a
commit
2ac6ac005a
8 files changed
+496
-158
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=false \
|
||||
POETRY_NO_INTERACTION=1 \
|
||||
POETRY_REQUESTS_TIMEOUT=120 \
|
||||
POETRY_INSTALLER_MAX_WORKERS=4
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install --no-cache-dir poetry
|
||||
|
||||
# Dependencies first, for layer caching
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN --mount=type=cache,target=/root/.cache/pypoetry \
|
||||
poetry install --only main --no-root --no-ansi
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "museum_analytics.museum_api:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in new issue
Block a user