Add systemd user service
This commit is contained in:
15
bardak.service
Normal file
15
bardak.service
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Bardak inventory webapp
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
#User=
|
||||||
|
#Group=
|
||||||
|
WorkingDirectory=/home/maybetree/srv/klankschool-bardak
|
||||||
|
ExecStart=./run.sh
|
||||||
|
Restart=on-failure
|
||||||
|
StandardOutput=file:%h/log_file
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
|
|
||||||
2
build.sh
2
build.sh
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update --recursive
|
git submodule update --recursive
|
||||||
|
|
||||||
|
|||||||
3
enable-user-service.sh
Normal file
3
enable-user-service.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
systemctl --user enable bardak.service
|
||||||
12
run.sh
12
run.sh
@ -1,8 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
mkdir -p ./data/things
|
mkdir -p ./data/things
|
||||||
mkdir -p ./data/trash
|
mkdir -p ./data/trash
|
||||||
|
|
||||||
|
if [ -z "$(podman images -q gateau-cuda11)" ]
|
||||||
|
then
|
||||||
|
echo "Container missing, building..."
|
||||||
|
./build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
podman run \
|
podman run \
|
||||||
--name bardak \
|
--name bardak \
|
||||||
--init \
|
--init \
|
||||||
@ -10,8 +18,8 @@ podman run \
|
|||||||
-v ./data/things:/app/things \
|
-v ./data/things:/app/things \
|
||||||
-v ./data/trash:/app/trash \
|
-v ./data/trash:/app/trash \
|
||||||
--publish 8085:8085 \
|
--publish 8085:8085 \
|
||||||
--detach \
|
`#--detach` \
|
||||||
--restart=always \
|
`#--restart=always` \
|
||||||
--replace \
|
--replace \
|
||||||
bardak
|
bardak
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user