separate images, no more .env

This commit is contained in:
msramalho
2025-02-10 23:49:08 +00:00
parent 6f3d3427c8
commit 37ebba73bf
6 changed files with 38 additions and 11 deletions

23
web.Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Stage 1: install dependencies
FROM python:3.10-slim AS build
WORKDIR /aa-api
# TODO: multistage build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir poetry
COPY pyproject.toml poetry.lock .
RUN poetry install --with web --no-interaction --no-ansi --no-root --no-cache
# Copy the application code
COPY alembic.ini ./
COPY .env* ./app/
COPY ./secrets/ ./secrets/
COPY ./app/ ./app/
# Run the FastAPI app with Uvicorn
ENTRYPOINT ["poetry", "run"]