@@ -17,26 +17,24 @@ ARG SYNAPSE_VERSION=latest
1717# the same debian version as Synapse's docker image (so the versions of the
1818# shared libraries match).
1919
20- FROM postgres:13-bullseye AS postgres_base
21- # initialise the database cluster in /var/lib/postgresql
22- RUN gosu postgres initdb --locale=C --encoding=UTF-8 --auth-host password
23-
24- # Configure a password and create a database for Synapse
25- RUN echo "ALTER USER postgres PASSWORD 'somesecret'" | gosu postgres postgres --single
26- RUN echo "CREATE DATABASE synapse" | gosu postgres postgres --single
27-
2820# now build the final image, based on the Synapse image.
2921
3022FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION
3123 # copy the postgres installation over from the image we built above
3224 RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
33- COPY --from=postgres_base /var/lib/postgresql /var/lib/postgresql
34- COPY --from=postgres_base /usr/lib/postgresql /usr/lib/postgresql
35- COPY --from=postgres_base /usr/share/postgresql /usr/share/postgresql
25+ COPY --from=postgres:13-bullseye /usr/lib/postgresql /usr/lib/postgresql
26+ COPY --from=postgres:13-bullseye /usr/share/postgresql /usr/share/postgresql
3627 RUN mkdir /var/run/postgresql && chown postgres /var/run/postgresql
3728 ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
3829 ENV PGDATA=/var/lib/postgresql/data
3930
31+ # initialise the database cluster in /var/lib/postgresql
32+ RUN gosu postgres initdb --locale=C --encoding=UTF-8 --auth-host password
33+
34+ # Configure a password and create a database for Synapse
35+ RUN echo "ALTER USER postgres PASSWORD 'somesecret'" | gosu postgres postgres --single
36+ RUN echo "CREATE DATABASE synapse" | gosu postgres postgres --single
37+
4038 # Extend the shared homeserver config to disable rate-limiting,
4139 # set Complement's static shared secret, enable registration, amongst other
4240 # tweaks to get Synapse ready for testing.
0 commit comments