summary refs log tree commit diff
diff options
context:
space:
mode:
authorkaiyou <pierre@jaury.eu>2018-02-04 10:58:07 +0100
committerkaiyou <pierre@jaury.eu>2018-02-04 10:58:07 +0100
commit48bc22f89dadb8278cf2b8c940604534999d246f (patch)
tree6d8555aec7cb90466889f6e6d6dfd07fe524ada4
parentAdd template config files for the Docker image (diff)
downloadsynapse-48bc22f89dadb8278cf2b8c940604534999d246f.tar.xz
Allow for a wheel cache and include missing files in the build
-rw-r--r--.dockerignore5
-rw-r--r--Dockerfile13
-rwxr-xr-xcontrib/docker/start.py1
3 files changed, 13 insertions, 6 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000..f36f86fbb7
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+Dockerfile
+.travis.yml
+.gitignore
+demo/etc
+tox.ini
diff --git a/Dockerfile b/Dockerfile
index 5f0433004f..277246b697 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,15 +2,16 @@ FROM python:2-alpine
 
 RUN apk add --no-cache --virtual .nacl_deps build-base libffi-dev zlib-dev openssl-dev libjpeg-turbo-dev linux-headers
 
-COPY synapse /usr/local/src/synapse
-COPY setup.py setup.cfg README.rst synctl /usr/local/src/
+COPY . /synapse
 
-RUN cd /usr/local/src \
- && pip install --upgrade --process-dependency-links . \
+# A wheel cache may be provided in ./cache for faster build
+RUN cd /synapse \
+ && pip install --upgrade pip setuptools \
+ && mkdir -p /synapse/cache \
+ && pip install -f /synapse/cache --upgrade --process-dependency-links . \
+ && mv /synapse/contrib/docker/* / \
  && rm -rf setup.py setup.cfg synapse
 
-COPY contrib/docker /
-
 VOLUME ["/data"]
 
 ENTRYPOINT ["/start.py"]
diff --git a/contrib/docker/start.py b/contrib/docker/start.py
index 4f63ea1ad5..2c427ba1b7 100755
--- a/contrib/docker/start.py
+++ b/contrib/docker/start.py
@@ -22,6 +22,7 @@ if mode == "generate":
 # Parse the configuration file
 if not os.path.exists("/compiled"):
     os.mkdir("/compiled")
+
 convert("/conf/homeserver.yaml", "/compiled/homeserver.yaml")
 convert("/conf/log.config", "/compiled/%s.log.config" % os.environ.get("SYNAPSE_SERVER_NAME"))