1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 03:50:15 +02:00

Update Dockerfile

Dockerfile: add Python & psycopg2 support for external auth scripts

This change installs python3, pip, and required build deps
in both build and runtime stages, and globally installs
bcrypt and psycopg2.

Motivation:
- ejabberd supports external authentication scripts written
  in Python.
- These scripts often require bcrypt (password hashing) and
  psycopg2 (PostgreSQL driver).
- Currently, users need to extend the official image to add
  these dependencies manually.

With this change, the official Docker image can run Python
auth scripts out of the box.
This commit is contained in:
paulo-roger 2025-08-18 14:43:32 -03:00 committed by GitHub
parent ff3d33dde4
commit b720143cae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,11 @@ RUN go install -v \
FROM docker.io/erlang:${OTP_VSN}-alpine AS ejabberd FROM docker.io/erlang:${OTP_VSN}-alpine AS ejabberd
RUN apk -U add --no-cache \ RUN apk -U add --no-cache \
python3 \
py3-pip \
build-base \
postgresql-dev \
python3-dev \
autoconf \ autoconf \
automake \ automake \
bash \ bash \
@ -37,6 +42,9 @@ RUN apk -U add --no-cache \
yaml-dev \ yaml-dev \
zlib-dev zlib-dev
# Install Python packages globally
RUN pip3 install --no-cache-dir --break-system-packages bcrypt psycopg2
ARG ELIXIR_VSN ARG ELIXIR_VSN
RUN wget -O - https://github.com/elixir-lang/elixir/archive/v$ELIXIR_VSN.tar.gz \ RUN wget -O - https://github.com/elixir-lang/elixir/archive/v$ELIXIR_VSN.tar.gz \
| tar -xzf - | tar -xzf -
@ -171,6 +179,15 @@ RUN apk -U upgrade --available --no-cache \
&& rm /tmp/runDeps \ && rm /tmp/runDeps \
&& ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so && ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so
RUN apk -U add --no-cache \
python3 \
py3-pip \
build-base \
postgresql-dev \
python3-dev
# Install Python packages globally
RUN pip3 install --no-cache-dir --break-system-packages bcrypt psycopg2
ARG USER ARG USER
ARG UID ARG UID
ARG HOME ARG HOME