Create a testing docker image
parent
58163d6678
commit
7c58540409
@ -0,0 +1,16 @@
|
||||
/db.sqlite3*
|
||||
Session.vim
|
||||
/local_settings.py
|
||||
.venv
|
||||
/assets
|
||||
/logs
|
||||
/.coverage
|
||||
/tmp
|
||||
/media
|
||||
|
||||
__pycache__
|
||||
.*.swp
|
||||
|
||||
/.*
|
||||
|
||||
/sandbox
|
@ -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…
Reference in New Issue