diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 00000000..1d17dae1 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1 @@ +.venv diff --git a/backend/Dockerfile b/backend/Dockerfile index a195bfbd..95b8ea5c 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,31 +1,14 @@ # Backend Dockerfile FROM python:3.11 -ARG TARGETOS -ARG TARGETARCH -ARG TARGETVARIANT - -# Install system dependencies -RUN apt-get update && rm -rf /var/lib/apt/lists/* -RUN wget -O golang-migrate.deb https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.${TARGETOS}-${TARGETARCH}${TARGETVARIANT}.deb \ - && dpkg -i golang-migrate.deb \ - && rm golang-migrate.deb - -# Install Poetry -RUN pip install poetry - # Set the working directory WORKDIR /backend -# Copy only dependencies -COPY pyproject.toml poetry.lock* ./ +# Copy the application +COPY . . # Install all dependencies -RUN poetry config virtualenvs.create false \ - && poetry install --no-interaction --no-ansi - -# Copy the rest of application code -COPY . . +RUN pip install -e . HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --start-interval=1s --retries=3 CMD [ "curl", "-f", "http://localhost:8000/ok" ]