@@ -13,8 +13,8 @@ RUN curl -OL "https://github.com/caddyserver/caddy/releases/download/v2.3.0/cadd
13
13
tar xzf caddy_2.3.0_linux_amd64.tar.gz && rm caddy_2.3.0_linux_amd64.tar.gz && mv caddy /root
14
14
15
15
# Install postgresql
16
- RUN apt-get update
17
- RUN apt-get install -y postgresql
16
+ RUN apt-get update && \
17
+ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends - y postgresql-13
18
18
19
19
# Configure a user and create a database for Synapse
20
20
RUN pg_ctlcluster 13 main start && su postgres -c "echo \
@@ -34,40 +34,14 @@ WORKDIR /data
34
34
# Copy the caddy config
35
35
COPY conf-workers/caddy.complement.json /root/caddy.json
36
36
37
+ # Copy the entrypoint
38
+ COPY conf-workers/start-complement-synapse-workers.sh /
39
+
37
40
# Expose caddy's listener ports
38
41
EXPOSE 8008 8448
39
42
40
- ENTRYPOINT \
41
- # Replace the server name in the caddy config
42
- sed -i "s/{{ server_name }}/${SERVER_NAME}/g" /root/caddy.json && \
43
- # Start postgres
44
- pg_ctlcluster 13 main start 2>&1 && \
45
- # Start caddy
46
- /root/caddy start --config /root/caddy.json 2>&1 && \
47
- # Set the server name of the homeserver
48
- SYNAPSE_SERVER_NAME=${SERVER_NAME} \
49
- # No need to report stats here
50
- SYNAPSE_REPORT_STATS=no \
51
- # Set postgres authentication details which will be placed in the homeserver config file
52
- POSTGRES_PASSWORD=somesecret POSTGRES_USER=postgres POSTGRES_HOST=localhost \
53
- # Specify the workers to test with
54
- SYNAPSE_WORKER_TYPES="\
55
- event_persister, \
56
- event_persister, \
57
- background_worker, \
58
- frontend_proxy, \
59
- event_creator, \
60
- user_dir, \
61
- media_repository, \
62
- federation_inbound, \
63
- federation_reader, \
64
- federation_sender, \
65
- synchrotron, \
66
- appservice, \
67
- pusher" \
68
- # Run the script that writes the necessary config files and starts supervisord, which in turn
69
- # starts everything else
70
- /configure_workers_and_start.py
43
+ ENTRYPOINT /start-complement-synapse-workers.sh
71
44
45
+ # Update the healthcheck to have a shorter check interval
72
46
HEALTHCHECK --start-period=5s --interval=1s --timeout=1s \
73
47
CMD /bin/sh /healthcheck.sh
0 commit comments