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 ]
|
63
Dockerfile
63
Dockerfile
|
@ -1,36 +1,31 @@
|
|||
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 \
|
||||
py-pip \
|
||||
py-virtualenv \
|
||||
py-setuptools \
|
||||
python-dev \
|
||||
postgresql-dev \
|
||||
build-base \
|
||||
linux-headers \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
tiff-dev \
|
||||
bash \
|
||||
sqlite \
|
||||
su-exec \
|
||||
openldap-dev \
|
||||
&& virtualenv -p python2.7 /synapse \
|
||||
&& source /synapse/bin/activate \
|
||||
&& pip install --upgrade \
|
||||
setuptools \
|
||||
cffi \
|
||||
incremental \
|
||||
python-ldap \
|
||||
psycopg2 \
|
||||
&& pip install https://github.com/matrix-org/synapse/tarball/master \
|
||||
&& mkdir /data
|
||||
RUN apk add --update \
|
||||
python2 \
|
||||
py-pip \
|
||||
py-virtualenv \
|
||||
py-setuptools \
|
||||
python-dev \
|
||||
postgresql-dev \
|
||||
build-base \
|
||||
linux-headers \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
tiff-dev \
|
||||
bash \
|
||||
sqlite \
|
||||
su-exec \
|
||||
openldap-dev \
|
||||
&& pip install --upgrade \
|
||||
setuptools \
|
||||
cffi \
|
||||
incremental \
|
||||
python-ldap \
|
||||
psycopg2 \
|
||||
&& pip install https://github.com/matrix-org/synapse/tarball/master \
|
||||
&& mkdir /data
|
||||
|
||||
ADD root /
|
||||
VOLUME /data
|
||||
EXPOSE 8448 8008
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/run.sh"]
|
||||
CMD ["start"]
|
||||
ADD root /
|
||||
VOLUME /data
|
||||
EXPOSE 8448 8008
|
||||
|
|
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