Use mountable database folder

This commit is contained in:
Sascha Ißbrücker 2019-07-03 19:50:25 +02:00
parent d57ea27ba3
commit c489f354c5
5 changed files with 25 additions and 3 deletions

2
.gitignore vendored
View File

@ -227,3 +227,5 @@ typings/
/static
# Build output, etc.
/tmp
# Database file
/data

View File

@ -18,5 +18,22 @@
</library>
</libraries>
</data-source>
<data-source source="LOCAL" name="db [2]" uuid="037e6f47-0871-42e5-8f52-6fdef1f306f2">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/data/db.sqlite3</jdbc-url>
<driver-properties>
<property name="enable_load_extension" value="true" />
</driver-properties>
<libraries>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar</url>
</library>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt</url>
</library>
</libraries>
</data-source>
</component>
</project>

View File

@ -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

View File

@ -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 .

View File

@ -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'),
}
}