diff --git a/services/code-forge/README.md b/services/code-forge/README.md new file mode 100644 index 0000000..b6a0ebe --- /dev/null +++ b/services/code-forge/README.md @@ -0,0 +1,27 @@ +# Code Forge + +Forgejo instance serving https://forge.karnov.club. + +## Usage + +### Starting / restarting + +```bash +FORGEJO_ROOT= ./start.sh +``` + +The storage root should be readable+writable by the user within the container. + +Calling the `start.sh` script will replace the containers if they already exists. + +### Stopping + +```bash +./stop.sh +``` + +## Networking + +| Port | Notes | +|---|---| +|`3000`|Web listening port| diff --git a/services/code-forge/start.sh b/services/code-forge/start.sh new file mode 100755 index 0000000..caa1b2f --- /dev/null +++ b/services/code-forge/start.sh @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +if [[ -z "$FORGEJO_ROOT" ]]; then + echo "Error: FORGEJO_ROOT must be defined in the environment." + exit 1 +fi + +podman pod create \ + -p 3000:3000 \ + --replace \ + "code-forge" + +podman run -itd \ + --name "code-forge_app" \ + --pod "code-forge" \ + -v "$FORGEJO_ROOT"/data:/var/lib/gitea \ + -v "$FORGEJO_ROOT"/config:/etc/gitea \ + -v /etc/timezone:/etc/timezone:ro \ + -v /etc/localtime:/etc/localtime:ro \ + --replace \ + codeberg.org/forgejo/forgejo:1.21.8-0-rootless diff --git a/services/code-forge/stop.sh b/services/code-forge/stop.sh new file mode 100755 index 0000000..784b968 --- /dev/null +++ b/services/code-forge/stop.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +podman pod stop "code-forge"