diff --git a/install.sh b/install.sh index 4310669..33ab4fd 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,10 @@ -podman stop ttt-org -podman rm ttt-org +systemctl --user stop ttt-org +podman rm ttt-org --force sed -i "s/DATE/$(date -I)/g" index.html sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" index.html podman build -t ttt-org . -podman run --name ttt-org -p 8084:80 -d ttt-org - -podman generate systemd ttt-org > ~/.config/systemd/user/ttt-org.service +cp ttt-org.container ~/.config/containers/systemd systemctl --user daemon-reload -systemctl --user enable ttt-org.service +systemctl --user start ttt-org +podman run --name ttt-org -p 8084:80 -d ttt-org diff --git a/ttt-org.container b/ttt-org.container new file mode 100644 index 0000000..f5a08ee --- /dev/null +++ b/ttt-org.container @@ -0,0 +1,13 @@ +[Unit] +Description=TechTransThai.org Website + +[Container] +ContainerName=ttt-org +Image=ttt-org +PublishPort=8084:80 + +[Service] +Restart=always + +[Install] +WantedBy=multi-user.target default.target