feat(forge): code-forge start+stop scripts
This commit is contained in:
parent
e5ade1edda
commit
249a3aec36
3 changed files with 51 additions and 0 deletions
27
services/code-forge/README.md
Normal file
27
services/code-forge/README.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Code Forge
|
||||
|
||||
Forgejo instance serving https://forge.karnov.club.
|
||||
|
||||
## Usage
|
||||
|
||||
### Starting / restarting
|
||||
|
||||
```bash
|
||||
FORGEJO_ROOT=<path-to-app-storage-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|
|
21
services/code-forge/start.sh
Executable file
21
services/code-forge/start.sh
Executable file
|
@ -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
|
3
services/code-forge/stop.sh
Executable file
3
services/code-forge/stop.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
podman pod stop "code-forge"
|
Reference in a new issue