Add budybase
This commit is contained in:
parent
dbef6baf09
commit
f6f7521ffe
20 changed files with 122 additions and 12 deletions
0
ressources/babybuddy/rootfs/DEBIAN/changelog
Normal file
0
ressources/babybuddy/rootfs/DEBIAN/changelog
Normal file
1
ressources/babybuddy/rootfs/DEBIAN/conffiles
Normal file
1
ressources/babybuddy/rootfs/DEBIAN/conffiles
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/babybuddy/production.py
|
8
ressources/babybuddy/rootfs/DEBIAN/control
Normal file
8
ressources/babybuddy/rootfs/DEBIAN/control
Normal file
|
@ -0,0 +1,8 @@
|
|||
Package: babybuddy
|
||||
Version: %VERSION%
|
||||
Section: contrib
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends: python3 ( >= 3.7 ), python-is-python3, python3-venv
|
||||
Maintainer: Thomas Legay <thomas@lgy.fr>
|
||||
Description: babybuddy
|
19
ressources/babybuddy/rootfs/DEBIAN/postinst
Executable file
19
ressources/babybuddy/rootfs/DEBIAN/postinst
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
APP=babybuddy
|
||||
HOMEDIR=/var/lib/babybuddy/
|
||||
|
||||
[ -d ${HOMEDIR} ] || mkdir -p ${HOMEDIR}
|
||||
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d ${HOMEDIR}
|
||||
|
||||
chown ${APP}:${APP} ${HOMEDIR}
|
||||
|
||||
systemctl | grep ${APP} | grep -q running && systemctl daemon-reload && systemctl restart ${APP}
|
||||
|
||||
if [[ $(systemctl list-unit-files | grep ${APP}.services) -eq 0 ]]
|
||||
then
|
||||
systemctl daemon-reload
|
||||
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
|
||||
then
|
||||
systemctl restart ${APP}
|
||||
fi
|
||||
fi
|
1
ressources/babybuddy/rootfs/etc/default/babybuddy
Normal file
1
ressources/babybuddy/rootfs/etc/default/babybuddy
Normal file
|
@ -0,0 +1 @@
|
|||
DJANGO_SETTINGS_MODULE=babybuddy.settings.production
|
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=babybuddy
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=babybuddy
|
||||
Group=babybuddy
|
||||
EnvironmentFile=/etc/default/babybuddy
|
||||
ExecStartPre=python3 -m venv /var/lib/babybuddy/.venv
|
||||
ExecStartPre=/var/lib/babybuddy/.venv/bin/pip install -r /usr/share/babybuddy/requirements.txt
|
||||
ExecStartPre=/var/lib/babybuddy/.venv/bin/python3 /usr/share/babybuddy/manage.py migrate
|
||||
ExecStartPre=/var/lib/babybuddy/.venv/bin/python3 /usr/share/babybuddy/manage.py createcachetable
|
||||
ExecStart=/var/lib/babybuddy/.venv/bin/python3 /usr/share/babybuddy/manage.py runserver 0.0.0.0:8000
|
||||
WorkingDirectory=/var/lib/babybuddy
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue