mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-25 20:09:21 -05:00
make python 3 work in the docker container
This commit is contained in:
parent
23b53b4ef8
commit
8dfb33d325
@ -2,6 +2,7 @@ Dockerfile
|
|||||||
.travis.yml
|
.travis.yml
|
||||||
.gitignore
|
.gitignore
|
||||||
demo/etc
|
demo/etc
|
||||||
|
synctl
|
||||||
tox.ini
|
tox.ini
|
||||||
.git/*
|
.git/*
|
||||||
.tox/*
|
.tox/*
|
||||||
|
@ -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
|
COPY . /synapse
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ RUN apk add --no-cache --virtual .build_deps \
|
|||||||
postgresql-dev \
|
postgresql-dev \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
&& cd /synapse \
|
&& cd /synapse \
|
||||||
|
&& sed -i 's/\["synctl"\] + //' setup.py \
|
||||||
&& apk add --no-cache --virtual .runtime_deps \
|
&& apk add --no-cache --virtual .runtime_deps \
|
||||||
libffi \
|
libffi \
|
||||||
libjpeg-turbo \
|
libjpeg-turbo \
|
||||||
|
@ -5,6 +5,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import glob
|
import glob
|
||||||
|
import codecs
|
||||||
|
|
||||||
# Utility functions
|
# Utility functions
|
||||||
convert = lambda src, dst, environ: open(dst, "w").write(jinja2.Template(open(src).read()).render(**environ))
|
convert = lambda src, dst, environ: open(dst, "w").write(jinja2.Template(open(src).read()).render(**environ))
|
||||||
@ -23,7 +24,7 @@ def generate_secrets(environ, secrets):
|
|||||||
with open(filename) as handle: value = handle.read()
|
with open(filename) as handle: value = handle.read()
|
||||||
else:
|
else:
|
||||||
print("Generating a random secret for {}".format(name))
|
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)
|
with open(filename, "w") as handle: handle.write(value)
|
||||||
environ[secret] = value
|
environ[secret] = value
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user