Add 15 and update 3 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 47s

This commit is contained in:
j
2025-12-17 18:25:24 +13:00
parent 2222a77070
commit 245837a872
18 changed files with 315 additions and 3 deletions

30
gitea-server/start.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "DATA_VOLUME" "HTTP_PORT" "SSH_PORT"
# START SCRIPT
# The start script is required for all templates.
# It is used to start the service on the server.
DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
--name ${CONTAINER_NAME} \
-p ${HTTP_PORT}:3000 \
-p ${SSH_PORT}:22 \
-v ${DATA_VOLUME}:/data \
-e USER_UID=1000 \
-e USER_GID=1000 \
${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG}"
if ! _create_and_start_container "$DOCKER_RUN_CMD" "$CONTAINER_NAME"; then
_die "Failed to start container ${CONTAINER_NAME}"
fi
# Check if the container is running
if ! _is_container_running "$CONTAINER_NAME"; then
_die "Container ${CONTAINER_NAME} is not running"
fi
echo "Container ${CONTAINER_NAME} started"
echo "Access Gitea at http://localhost:${HTTP_PORT}"
echo "SSH clone available on port ${SSH_PORT}"