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

Commit 42dd992

Browse files
Mathieu Veltenrichvdh
Mathieu Velten
andauthored
Dockerfile for tests: align comments with current behavior (#13867)
Signed-off-by: Mathieu Velten <[email protected]> Co-authored-by: Richard van der Hoff <[email protected]>
1 parent 50c92f3 commit 42dd992

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

changelog.d/13867.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correct the comments in the complement dockerfile.

docker/complement/Dockerfile

+9-13
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,23 @@
88

99
ARG SYNAPSE_VERSION=latest
1010

11-
# first of all, we create a base image with a postgres server and database,
12-
# which we can copy into the target image. For repeated rebuilds, this is
13-
# much faster than apt installing postgres each time.
14-
#
15-
# This trick only works because (a) the Synapse image happens to have all the
16-
# shared libraries that postgres wants, (b) we use a postgres image based on
17-
# the same debian version as Synapse's docker image (so the versions of the
18-
# shared libraries match).
19-
20-
# now build the final image, based on the Synapse image.
21-
2211
FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION
23-
# copy the postgres installation over from the image we built above
12+
# First of all, we copy postgres server from the official postgres image,
13+
# since for repeated rebuilds, this is much faster than apt installing
14+
# postgres each time.
15+
16+
# This trick only works because (a) the Synapse image happens to have all the
17+
# shared libraries that postgres wants, (b) we use a postgres image based on
18+
# the same debian version as Synapse's docker image (so the versions of the
19+
# shared libraries match).
2420
RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
2521
COPY --from=postgres:13-bullseye /usr/lib/postgresql /usr/lib/postgresql
2622
COPY --from=postgres:13-bullseye /usr/share/postgresql /usr/share/postgresql
2723
RUN mkdir /var/run/postgresql && chown postgres /var/run/postgresql
2824
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
2925
ENV PGDATA=/var/lib/postgresql/data
3026

31-
# initialise the database cluster in /var/lib/postgresql
27+
# We also initialize the database at build time, rather than runtime, so that it's faster to spin up the image.
3228
RUN gosu postgres initdb --locale=C --encoding=UTF-8 --auth-host password
3329

3430
# Configure a password and create a database for Synapse

0 commit comments

Comments
 (0)