Create a testing docker image

master
Dustin J. Mitchell 4 years ago committed by Tom Hacohen
parent 58163d6678
commit 7c58540409

@ -0,0 +1,16 @@
/db.sqlite3*
Session.vim
/local_settings.py
.venv
/assets
/logs
/.coverage
/tmp
/media
__pycache__
.*.swp
/.*
/sandbox

@ -138,6 +138,12 @@ Here are the update steps:
4. Run the migration tool to migrate all of your data.
5. Add your new EteSync 2.0 accounts to all of your devices.
# Testing
Docker images named `etesync/test-server:<version>` and `:latest` are available for testing etesync clients.
This docker image starts a server on port 3735 that supports user signup (without email confirmation), is in debug mode (thus supporting the reset endpoint), and stores its data locally.
It is in no way suitable for production usage, but is able to start up quickly and makes a good component of CI for etesync clients and users of those clients.
# License
Etebase is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. See the [LICENSE](./LICENSE) for more information.

@ -0,0 +1,16 @@
#! /bin/bash
# Build the `test-server` image, which runs the server in a simple configuration
# designed to be used in tests, based on the current git revision.
TAG="${1:-latest}"
echo "Building working copy to etesync/test-server:${TAG}"
ETESYNC_VERSION=$(git describe --tags)
docker build \
--build-arg ETESYNC_VERSION=${ETESYNC_VERSION} \
-t etesync/test-server:${TAG} \
-f docker/test-server/Dockerfile \
.

@ -0,0 +1,38 @@
FROM python:3.9.0-alpine
ARG ETESYNC_VERSION
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
# install packages and pip requirements first, in a single step,
COPY /requirements.txt /requirements.txt
RUN set -ex ;\
apk add libpq postgresql-dev --virtual .build-deps coreutils gcc libc-dev libffi-dev make ;\
pip install -U pip ;\
pip install --no-cache-dir --progress-bar off -r /requirements.txt ;\
apk del .build-deps make gcc coreutils ;\
rm -rf /root/.cache
COPY . /app
RUN set -ex ;\
mkdir -p /data/static /data/media ;\
cd /app ;\
mkdir -p /etc/etebase-server ;\
cp docker/test-server/etebase-server.ini /etc/etebase-server ;\
sed -e '/ETEBASE_CREATE_USER_FUNC/ s/^#*/#/' -i /app/etebase_server/settings.py ;\
chmod +x docker/test-server/entrypoint.sh
# this is a test image and should start up quickly, so it starts with the DB
# and static data already fully set up.
RUN set -ex ;\
cd /app ;\
python manage.py migrate ;\
python manage.py collectstatic --noinput
ENV ETESYNC_VERSION=${ETESYNC_VERSION}
VOLUME /data
EXPOSE 3735
ENTRYPOINT ["/app/docker/test-server/entrypoint.sh"]

@ -0,0 +1,6 @@
#! /bin/sh
echo "Running etesync test server ${ETESYNC_VERSION}"
cd /app
uvicorn etebase_server.asgi:application --host 0.0.0.0 --port 3735

@ -0,0 +1,12 @@
[global]
secret_file = secret.txt
debug = true
static_root = /data/static
media_root = /data/media
[allowed_hosts]
allowed_host1 = *
[database]
engine = django.db.backends.sqlite3
name = /db.sqlite3
Loading…
Cancel
Save