FROM python:3.13-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV UV_SYSTEM_PYTHON=1

RUN mkdir /code

WORKDIR /code
COPY pyproject.toml /code

RUN apt-get update && \
    apt-get install -y gcc git nginx gettext vim libpq-dev && \
    pip install uv && \
    uv pip install -r pyproject.toml && \
    apt-get autoremove -y

COPY . /code

RUN ["sh", "scripts/build_static.sh"]
CMD ["sh", "./scripts/run.sh"]
