32 lines
693 B
Docker
32 lines
693 B
Docker
FROM python:3.11-slim as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./pyproject.toml /app
|
|
|
|
RUN apt update && \
|
|
apt install -y --no-install-recommends proj-bin && \
|
|
apt clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --upgrade poetry && \
|
|
poetry config virtualenvs.create false && \
|
|
poetry install --only=main && \
|
|
poetry export -f requirements.txt >> requirements.txt
|
|
|
|
FROM python:3.11-slim as runtime
|
|
|
|
COPY . /app
|
|
COPY --from=builder /app/requirements.txt /app
|
|
|
|
RUN apt update && \
|
|
apt install -y --no-install-recommends postgresql libpq5 && \
|
|
apt clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
WORKDIR /app
|
|
|
|
CMD ["python", "./main.py"]
|