This commit is contained in:
parent
71518d7921
commit
f7868ae828
6 changed files with 58 additions and 66 deletions
6
.drone.yml
Normal file
6
.drone.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
pipeline:
|
||||
docker:
|
||||
image: plugins/docker
|
||||
repo: docker.jcg.re/synapse
|
||||
registry: docker.jcg.re
|
||||
secrets: [ docker_username, docker_password ]
|
|
@ -1,5 +1,5 @@
|
|||
FROM alpine:edge
|
||||
MAINTAINER Jan Christian Grünhage
|
||||
FROM docker.jcg.re/base-alpine
|
||||
MAINTAINER Jan Christian Grünhage <jan.christian@gruenhage.xyz>
|
||||
|
||||
RUN apk add --update \
|
||||
python2 \
|
||||
|
@ -17,8 +17,6 @@ RUN apk add --update \
|
|||
sqlite \
|
||||
su-exec \
|
||||
openldap-dev \
|
||||
&& virtualenv -p python2.7 /synapse \
|
||||
&& source /synapse/bin/activate \
|
||||
&& pip install --upgrade \
|
||||
setuptools \
|
||||
cffi \
|
||||
|
@ -31,6 +29,3 @@ RUN apk add --update \
|
|||
ADD root /
|
||||
VOLUME /data
|
||||
EXPOSE 8448 8008
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/run.sh"]
|
||||
CMD ["start"]
|
||||
|
|
2
root/etc/s6.d/synapse/finish
Executable file
2
root/etc/s6.d/synapse/finish
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec /bin/true
|
4
root/etc/s6.d/synapse/run
Executable file
4
root/etc/s6.d/synapse/run
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
cd /data
|
||||
exec su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
|
||||
--config-path /data/config/homeserver.yaml
|
17
root/usr/local/bin/generate
Executable file
17
root/usr/local/bin/generate
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
chown ${UID}:${GID} /data
|
||||
[[ -z "${SERVER_NAME}" ]] && echo "STOP! environment variable SERVER_NAME must be set" && breakup="1"
|
||||
[[ -z "${REPORT_STATS}" ]] && echo "STOP! environment variable REPORT_STATS must be set to 'no' or 'yes'" && breakup="1"
|
||||
[[ "${REPORT_STATS}" != "yes" ]] && [[ "${REPORT_STATS}" != "no" ]] && \
|
||||
echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
|
||||
[[ "${breakup}" == "1" ]] && exit 1
|
||||
|
||||
su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
|
||||
-c /data/config/homeserver.yaml \
|
||||
--generate-config \
|
||||
-H ${SERVER_NAME} \
|
||||
--report-stats ${REPORT_STATS}
|
||||
sed -e 's#/homeserver.db#/data/database/homeserver.db#' \
|
||||
-e 's#/homeserver.log#/data/log/homeserver.log#' \
|
||||
-e 's#/media_store#/data/media_store#' \
|
||||
-e 's#/uploads#/data/uploads#' -i /data/config/homeserver.yaml
|
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
COMMAND="${1}"
|
||||
|
||||
prepare() {
|
||||
chown ${UID}:${GID} /data
|
||||
cd /synapse
|
||||
source bin/activate
|
||||
}
|
||||
|
||||
case ${COMMAND} in
|
||||
"start")
|
||||
prepare
|
||||
su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
|
||||
--config-path /data/config/homeserver.yaml
|
||||
;;
|
||||
"generate")
|
||||
breakup="0"
|
||||
[[ -z "${SERVER_NAME}" ]] && echo "STOP! environment variable SERVER_NAME must be set" && breakup="1"
|
||||
[[ -z "${REPORT_STATS}" ]] && echo "STOP! environment variable REPORT_STATS must be set to 'no' or 'yes'" && breakup="1"
|
||||
[[ "${breakup}" == "1" ]] && exit 1
|
||||
|
||||
[[ "${REPORT_STATS}" != "yes" ]] && [[ "${REPORT_STATS}" != "no" ]] && \
|
||||
echo "STOP! REPORT_STATS needs to be 'no' or 'yes'" && breakup="1"
|
||||
prepare
|
||||
su-exec ${UID}:${GID} python2 -m synapse.app.homeserver \
|
||||
-c /data/config/homeserver.yaml \
|
||||
--generate-config \
|
||||
-H ${SERVER_NAME} \
|
||||
--report-stats ${REPORT_STATS}
|
||||
;;
|
||||
esac
|
Loading…
Reference in a new issue