Created
March 22, 2024 22:11
-
-
Save mortn/5235f797cbf7cfaa840ec0cc18ee5753 to your computer and use it in GitHub Desktop.
Example of Podman pod running Nextcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.nextcloud.com/t/howto-nextcloud-as-a-rootless-container-using-podman-play-kube-with-centos8-stream/110377 | |
PODNAME=nxcl | |
DDIR=/var/lib/nextcloud | |
mkdir -p ${DDIR}/{nginx,html} | |
set -x | |
if (podman pod exists ${PODNAME}); then | |
podman rm -f ${PODNAME}-app | |
podman rm -f ${PODNAME}-cron | |
podman rm -f ${PODNAME}-redis | |
podman rm -f ${PODNAME}-nginx | |
podman rm -f ${PODNAME}-infra | |
podman pod rm -f ${PODNAME} | |
exit | |
fi | |
podman pod create --hostname ${PODNAME} --name ${PODNAME} --infra-name ${PODNAME}-infra -p 8080:80 | |
podman run -d --pod=${PODNAME} --name=${PODNAME}-redis --restart=always docker.io/library/redis:alpine redis-server --requirepass yourpassword | |
podman run -d --pod=${PODNAME} --name=${PODNAME}-app --restart=always \ | |
-e REDIS_HOST="localhost" \ | |
-e REDIS_HOST_PASSWORD="yourpassword" \ | |
-e MYSQL_HOST="mysql.local" \ | |
-e MYSQL_USER="nextcloud" \ | |
-e MYSQL_PASSWORD="passwrod" \ | |
-e MYSQL_DATABASE="nextcloud" \ | |
-v ${DDIR}/html:/var/www/html:z \ | |
-v /data/nextcloud/data:/var/www/html/data:z \ | |
docker.io/library/nextcloud:fpm-alpine | |
podman run -d --pod=${PODNAME} --name=${PODNAME}-cron --restart=always \ | |
-v ${DDIR}/html:/var/www/html:z \ | |
-v /data/nextcloud/data:/var/www/html/data:z \ | |
--entrypoint=/cron.sh \ | |
docker.io/library/nextcloud:fpm-alpine | |
NGURL=https://raw.githubusercontent.com/nextcloud/docker/master/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf | |
#curl -o ${DDIR}/nginx/nginx.conf ${NGURL} | |
podman run -d --pod=${PODNAME} --name=${PODNAME}-nginx --restart=always \ | |
-v ${DDIR}/html:/var/www/html:ro,z \ | |
-v /data/nextcloud/data:/var/www/html/data:ro,z \ | |
-v ${DDIR}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro,Z \ | |
docker.io/library/nginx:alpine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment