services-garbaye/podman-privatebin/10_install.sh

16 lines
1.3 KiB
Bash
Raw Normal View History

2021-05-26 20:15:55 +00:00
#!/usr/bin/env bash
git clone https://github.com/PrivateBin/docker-nginx-fpm-alpine
sed -i 's|fastcgi_pass unix:/run/php-fpm.sock;|fastcgi_pass unix:/run/s6/php-fpm.sock;|' docker-nginx-fpm-alpine/etc/nginx/http.d/site.conf
sed -i 's|pid /run/nginx.pid;|pid /run/s6/nginx.pid;|' docker-nginx-fpm-alpine/etc/nginx/nginx.conf
sed -i 's|listen = /run/php-fpm.sock|listen = /run/s6/php-fpm.sock|' docker-nginx-fpm-alpine/etc/php8/php-fpm.d/zz-docker.conf
cp conf.php docker-nginx-fpm-alpine/conf.php
grep -q conf.php docker-nginx-fpm-alpine/Dockerfile || sed -i '/^COPY.*/a COPY conf.php /srv/cfg/conf.php' docker-nginx-fpm-alpine/Dockerfile
podman build -t privatebin-nginx-fpm-alpine docker-nginx-fpm-alpine
podman volume create privatebin-data
podman volume create privatebin-run
podman volume create privatebin-var-lib-nginx-tmp
podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-data`
podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-run`
podman unshare chown -R 65534:82 `podman volume inspect --format '{{ .Mountpoint }}' privatebin-var-lib-nginx-tmp`
podman run -d --read-only --restart=always --name my-privatebin -p 8084:8080 -v privatebin-run:/run:Z -v privatebin-data:/srv/data:Z -v privatebin-var-lib-nginx-tmp:/var/lib/nginx/tmp:Z privatebin-nginx-fpm-alpine