diff options
Diffstat (limited to 'start_container.sh')
| -rwxr-xr-x | start_container.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/start_container.sh b/start_container.sh index bf1c167..25fcb10 100755 --- a/start_container.sh +++ b/start_container.sh | |||
| @@ -17,6 +17,16 @@ podman stop ${CONTAINER_NAME} 2>/dev/null || true | |||
| 17 | podman rm ${CONTAINER_NAME} 2>/dev/null || true | 17 | podman rm ${CONTAINER_NAME} 2>/dev/null || true |
| 18 | ip route del ${PUBLIC_IP}/32 2>/dev/null || true | 18 | ip route del ${PUBLIC_IP}/32 2>/dev/null || true |
| 19 | 19 | ||
| 20 | # Rebuild authorized_keys from .pub files | ||
| 21 | mkdir -p /git/.ssh | ||
| 22 | rm -f /git/.ssh/authorized_keys | ||
| 23 | cat /git/.ssh/*.pub > /git/.ssh/authorized_keys 2>/dev/null || true | ||
| 24 | chmod 600 /git/.ssh/authorized_keys | ||
| 25 | |||
| 26 | # Build image | ||
| 27 | echo "Building image..." | ||
| 28 | podman build -t cgit "$(dirname "$0")" | ||
| 29 | |||
| 20 | # Run container | 30 | # Run container |
| 21 | podman run -d \ | 31 | podman run -d \ |
| 22 | --name ${CONTAINER_NAME} \ | 32 | --name ${CONTAINER_NAME} \ |
| @@ -26,7 +36,7 @@ podman run -d \ | |||
| 26 | --env-file "$(dirname "$0")/config.env" \ | 36 | --env-file "$(dirname "$0")/config.env" \ |
| 27 | -v ${CONTAINER_NAME}_data:/data \ | 37 | -v ${CONTAINER_NAME}_data:/data \ |
| 28 | -v /git:/git \ | 38 | -v /git:/git \ |
| 29 | localhost/cgit-caddy | 39 | localhost/cgit |
| 30 | 40 | ||
| 31 | # Setup public IP | 41 | # Setup public IP |
| 32 | sleep 2 | 42 | sleep 2 |
