mirror of
https://gitlab.com/Snogard/kaido.git
synced 2025-08-20 10:50:06 +02:00
added pod template
This commit is contained in:
parent
ff37a3b884
commit
6ea8188250
50
src/templates/install-pod.sh
Normal file
50
src/templates/install-pod.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
source /opt/kaido/src/libs/bash/lib.sh
|
||||||
|
|
||||||
|
# setup
|
||||||
|
imageName_web=docker.io/
|
||||||
|
imageName_db=docker.io/
|
||||||
|
|
||||||
|
podName=
|
||||||
|
|
||||||
|
containerName_web=${podName}_web
|
||||||
|
containerName_db=${podName}_db
|
||||||
|
|
||||||
|
dstBasePath="$KAIDO_CONTAINER_FOLDER/$podName"
|
||||||
|
|
||||||
|
# envs
|
||||||
|
|
||||||
|
if [ -f "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh" ]; then
|
||||||
|
source "$KAIDO_CONFIG_FOLDER/containers/$podName/envs.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# pre install
|
||||||
|
create_folder "$dstBasePath"
|
||||||
|
stop_and_remove_pod $podName
|
||||||
|
|
||||||
|
|
||||||
|
#install
|
||||||
|
echo "Creating new $podName pod"
|
||||||
|
podman pod create \
|
||||||
|
--name $podName \
|
||||||
|
-p 80:80/tcp \
|
||||||
|
|
||||||
|
echo "Creating new $containerName_db container"
|
||||||
|
podman create \
|
||||||
|
--pod $podName \
|
||||||
|
--name $containerName_db \
|
||||||
|
-v $dstBasePath:/path/to/folder \
|
||||||
|
$imageName_db
|
||||||
|
|
||||||
|
echo "Creating new $containerName_web container"
|
||||||
|
podman create \
|
||||||
|
--pod $podName \
|
||||||
|
--name $containerName_web \
|
||||||
|
--requires $containerName_db \
|
||||||
|
-v $dstBasePath:/path/to/folder \
|
||||||
|
$imageName_web
|
||||||
|
|
||||||
|
# systemd
|
||||||
|
create_systemd_services $containerName
|
||||||
|
systemctl --user enable --now $containerName
|
Loading…
x
Reference in New Issue
Block a user