-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 794 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM public.ecr.aws/docker/library/python:3.12-slim-bullseye AS base
WORKDIR /app
ENV POETRY_HOME='/usr/local' \
VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=true \
POETRY_VIRTUALENVS_IN_PROJECT=true
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
build-essential \
ffmpeg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | python3 -
FROM base AS builder
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root --only main
COPY . .
FROM base AS final
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app .
EXPOSE 8000
CMD ["bash", "-c", "alembic upgrade head && fastapi run"]