Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
make python 3 work in the docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgruenhage committed Sep 20, 2018
1 parent 23b53b4 commit 8dfb33d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -2,6 +2,7 @@ Dockerfile
.travis.yml
.gitignore
demo/etc
synctl
tox.ini
.git/*
.tox/*
4 changes: 3 additions & 1 deletion docker/Dockerfile
@@ -1,4 +1,5 @@
FROM docker.io/python:2-alpine3.8
ARG PYTHON_VERSION=2
FROM docker.io/python:${PYTHON_VERSION}-alpine3.8

COPY . /synapse

Expand All @@ -12,6 +13,7 @@ RUN apk add --no-cache --virtual .build_deps \
postgresql-dev \
zlib-dev \
&& cd /synapse \
&& sed -i 's/\["synctl"\] + //' setup.py \
&& apk add --no-cache --virtual .runtime_deps \
libffi \
libjpeg-turbo \
Expand Down
3 changes: 2 additions & 1 deletion docker/start.py
Expand Up @@ -5,6 +5,7 @@
import sys
import subprocess
import glob
import codecs

# Utility functions
convert = lambda src, dst, environ: open(dst, "w").write(jinja2.Template(open(src).read()).render(**environ))
Expand All @@ -23,7 +24,7 @@ def generate_secrets(environ, secrets):
with open(filename) as handle: value = handle.read()
else:
print("Generating a random secret for {}".format(name))
value = os.urandom(32).encode("hex")
value = codecs.encode(os.urandom(32), "hex").decode()
with open(filename, "w") as handle: handle.write(value)
environ[secret] = value

Expand Down

0 comments on commit 8dfb33d

Please sign in to comment.