mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-06 14:55:07 +01:00
Add a dependency link between two containers and change the way Django migrations are done. Provide example for auto-starting the containers
This commit is contained in:
parent
c85b6b425d
commit
3f9ea7b971
4 changed files with 29 additions and 5 deletions
|
|
@ -42,9 +42,24 @@ set_permissions() {
|
|||
chown -Rh paperless:paperless /usr/src/paperless
|
||||
}
|
||||
|
||||
migrations() {
|
||||
# A simple lock file in case other containers use this startup
|
||||
LOCKFILE="/usr/src/paperless/data/db.sqlite3.migration"
|
||||
|
||||
set -o noclobber
|
||||
# check for and create lock file in one command
|
||||
(> ${LOCKFILE}) &> /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
sudo -HEu paperless "/usr/src/paperless/src/manage.py" "migrate"
|
||||
rm ${LOCKFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
initialize() {
|
||||
map_uidgid
|
||||
set_permissions
|
||||
migrations
|
||||
}
|
||||
|
||||
install_languages() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue