mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 15:39:00 +03:00
9006ee36d1
* remove reference in comments to python3.6 * upgrade tox python env in script * bump python version in example for completeness * upgrade python version requirement in setup doc * upgrade necessary python version in __init__.py * upgrade python version in setup.py * newsfragment * drops refs to bionic and replace with focal * bump refs to postgres 9.6 to 10 * fix hanging ci * try installing tzdata first * revert change made in b979f336 * ignore new random mypy error while debugging other error * fix lint error for temporary workaround * revert change to install list * try passing env var * export debian frontend var? * move line and add comment * bump pillow dependency * bump lxml depenency * install libjpeg-dev for pillow * bump automat version to one compatible with py3.8 * add libwebp for pillow * bump twisted trunk python version * change suffix of newsfragment * remove redundant python 3.7 checks * lint
30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
# Use the Sytest image that comes with a lot of the build dependencies
|
|
# pre-installed
|
|
FROM matrixdotorg/sytest:focal
|
|
|
|
# The Sytest image doesn't come with python, so install that
|
|
RUN apt-get update && apt-get -qq install -y python3 python3-dev python3-pip
|
|
|
|
# We need tox to run the tests in run_pg_tests.sh
|
|
RUN python3 -m pip install tox
|
|
|
|
# Initialise the db
|
|
RUN su -c '/usr/lib/postgresql/10/bin/initdb -D /var/lib/postgresql/data -E "UTF-8" --lc-collate="C.UTF-8" --lc-ctype="C.UTF-8" --username=postgres' postgres
|
|
|
|
# Add a user with our UID and GID so that files get created on the host owned
|
|
# by us, not root.
|
|
ARG UID
|
|
ARG GID
|
|
RUN groupadd --gid $GID user
|
|
RUN useradd --uid $UID --gid $GID --groups sudo --no-create-home user
|
|
|
|
# Ensure we can start postgres by sudo-ing as the postgres user.
|
|
RUN apt-get update && apt-get -qq install -y sudo
|
|
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
|
|
ADD run_pg_tests.sh /run_pg_tests.sh
|
|
# Use the "exec form" of ENTRYPOINT (https://docs.docker.com/engine/reference/builder/#entrypoint)
|
|
# so that we can `docker run` this container and pass arguments to pg_tests.sh
|
|
ENTRYPOINT ["/run_pg_tests.sh"]
|
|
|
|
USER user
|