scripts/fogcutter/podman/nginx.sh

47 lines
1.3 KiB
Bash
Raw Normal View History

2020-12-26 23:16:52 -05:00
#!/bin/bash
set -e
up () {
2020-12-28 19:38:09 -05:00
loginctl enable-linger $USER
2020-12-26 23:16:52 -05:00
podman network create pew-net || true
# main nginx container
2021-01-16 13:50:16 -05:00
# for local access hard-code IP in /etc/hosts and use browser addon to force redirect to 8443
2020-12-26 23:16:52 -05:00
podman create \
--name nginx \
--env PUID=1000 \
--env GUID=1000 \
--env TZ=US/Eastern \
--env URL=seaturtle.pw \
2020-12-27 03:14:45 -05:00
--env SUBDOMAINS=airsonic,git,jf,nc,plex \
2020-12-26 23:16:52 -05:00
--env VALIDATION=http \
--env EMAIL=paulsw.pw@gmail.com \
2021-01-09 13:17:54 -05:00
--volume /bigdata/files:/files:ro \
2020-12-26 23:16:52 -05:00
--volume /bigdata/k8s-config/nginx/config:/config:rw \
--volume /bigdata/k8s-config/nginx/nginx.conf:/config/nginx/nginx.conf:ro \
--volume /bigdata/k8s-config/nginx/ssl.conf:/config/nginx/ssl.conf:ro \
--volume /bigdata/k8s-config/nginx/site-confs:/config/nginx/site-confs:ro \
2021-01-16 17:28:15 -05:00
--publish 127.0.0.1:80:80 \
--publish 443:443 \
2020-12-26 23:16:52 -05:00
--network pew-net \
linuxserver/swag:1.10.1-ls29
2020-12-28 19:38:09 -05:00
podman generate systemd nginx --restart-policy=always --name > $HOME/.config/systemd/user/nginx.service
2020-12-26 23:16:52 -05:00
systemctl --user daemon-reload
2020-12-27 03:14:45 -05:00
systemctl start --user nginx || systemctl restart --user nginx
2020-12-26 23:16:52 -05:00
systemctl enable --user nginx
}
down () {
systemctl stop --user nginx || true
systemctl disable --user nginx || true
podman rm nginx || true
}
logs () {
podman logs --follow nginx
}
$@