You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit the Postgres Dockerfile to install build tools and compile the extension:
RUN apt-get update && apt-get install -y \
build-essential \
postgresql-server-dev-17
# pgjwt - used by the auth schemaCOPY ./pgjwt /pgjwt
WORKDIR /pgjwt
RUN make && make install
# Reset workdirWORKDIR /var/lib/postgresql
🧼 Set WORKDIR back to the default to avoid unintended effects.
3. Rebuild the Container
docker compose build postgres
That’s it — the extension is now available to load in your migrations.
🔌 Loading an Extension
To load extensions, create a migration file such as:
create extension pgcrypto;
⚠️create extension is non-transactional, so don’t wrap this in
BEGIN/COMMIT.