FROM python:3.11-slim-bullseye AS python-stage FROM postgres:17.4-bullseye COPY --from=python-stage /usr/local /usr/local COPY installer/*.sh /usr/bin/ COPY installer/init.sql /docker-entrypoint-initdb.d/ ARG DEPENDENCIES=" \ libexpat1-dev \ libffi-dev \ curl \ ca-certificates \ vim \ gettext \ wait-for-it \ redis-server \ postgresql-17-pgvector \ postgresql-17-age" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone && \ apt-get update && apt-get install -y --no-install-recommends $DEPENDENCIES && \ apt-get clean all && \ rm -rf /var/lib/apt/lists/* && \ chmod 755 /usr/bin/start-*.sh && \ find /etc/ -type f ! -path '/etc/resolv.conf' ! -path '/etc/hosts' | xargs chmod g-rx && \ curl -L --connect-timeout 120 -m 1800 https://resource.fit2cloud.com/maxkb/ffmpeg/get-ffmpeg-linux | sh ENV PGDATA=/opt/maxkb/data/postgresql/pgdata \ POSTGRES_USER=root \ POSTGRES_PASSWORD=Password123@postgres \ POSTGRES_MAX_CONNECTIONS=1000 \ REDIS_PASSWORD=Password123@redis \ LANG=en_US.UTF-8