From c489f354c56b19892822c19e6b0d1b626d75268f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Wed, 3 Jul 2019 19:50:25 +0200 Subject: [PATCH] Use mountable database folder --- .gitignore | 2 ++ .idea/dataSources.xml | 17 +++++++++++++++++ Dockerfile | 3 +++ build-docker.sh | 4 ++-- siteroot/settings.py | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8f15ae8..dc99747 100644 --- a/.gitignore +++ b/.gitignore @@ -227,3 +227,5 @@ typings/ /static # Build output, etc. /tmp +# Database file +/data diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 507b0ad..b091e4f 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -18,5 +18,22 @@ + + sqlite.xerial + true + org.sqlite.JDBC + jdbc:sqlite:$PROJECT_DIR$/data/db.sqlite3 + + + + + + file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar + + + file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2789f2d..939e0ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,9 @@ COPY uwsgi.ini . COPY bootstrap.sh . RUN ["chmod", "+x", "./bootstrap.sh"] +# Create data folder +RUN ["mkdir", "data"] + EXPOSE 9090 # Start uwsgi server diff --git a/build-docker.sh b/build-docker.sh index 0813d47..1c51aab 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash ./build-static.sh -#docker build -t sissbruecker/linkding . -docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t sissbruecker/linkding:latest --push . +docker build -t sissbruecker/linkding . +#docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t sissbruecker/linkding:latest --push . diff --git a/siteroot/settings.py b/siteroot/settings.py index ac558d8..77e096a 100644 --- a/siteroot/settings.py +++ b/siteroot/settings.py @@ -76,7 +76,7 @@ WSGI_APPLICATION = 'siteroot.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'NAME': os.path.join(BASE_DIR, 'data', 'db.sqlite3'), } }