Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Dockerfile for tests: align comments with current behavior #13867

Merged
merged 4 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13867.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct the comments in the complement dockerfile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous changelog and PR description could use some updating as well, see my comments over there, #13819 (comment)

22 changes: 9 additions & 13 deletions docker/complement/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,23 @@

ARG SYNAPSE_VERSION=latest

# first of all, we create a base image with a postgres server and database,
# which we can copy into the target image. For repeated rebuilds, this is
# much faster than apt installing postgres each time.
#
# This trick only works because (a) the Synapse image happens to have all the
# shared libraries that postgres wants, (b) we use a postgres image based on
# the same debian version as Synapse's docker image (so the versions of the
# shared libraries match).

# now build the final image, based on the Synapse image.

FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION
# copy the postgres installation over from the image we built above
# First of all, we copy postgres server from the official postgres image,
# since for repeated rebuilds, this is much faster than apt installing
# postgres each time.

# This trick only works because (a) the Synapse image happens to have all the
# shared libraries that postgres wants, (b) we use a postgres image based on
# the same debian version as Synapse's docker image (so the versions of the
# shared libraries match).
RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
COPY --from=postgres:13-bullseye /usr/lib/postgresql /usr/lib/postgresql
COPY --from=postgres:13-bullseye /usr/share/postgresql /usr/share/postgresql
RUN mkdir /var/run/postgresql && chown postgres /var/run/postgresql
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
ENV PGDATA=/var/lib/postgresql/data

# initialise the database cluster in /var/lib/postgresql
# We also initialize the database at build and not runtime for speed reason.
MatMaul marked this conversation as resolved.
Show resolved Hide resolved
RUN gosu postgres initdb --locale=C --encoding=UTF-8 --auth-host password

# Configure a password and create a database for Synapse
Expand Down