config: Add 1 and update 10 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 7s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 7s
This commit is contained in:
@@ -17,7 +17,7 @@ echo "Dumping MariaDB database..."
|
||||
docker exec "${CONTAINER_NAME}_db" mariadb-dump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${DATA_PATH}/database.sql" || _die "Failed to dump database"
|
||||
|
||||
# Stop containers for consistent backup
|
||||
docker compose stop
|
||||
docker compose -p "${CONTAINER_NAME}" stop
|
||||
|
||||
# Backup using dropshell's backup system
|
||||
# shellcheck disable=SC2046
|
||||
@@ -27,6 +27,6 @@ backup_items $(get_seafile_volumes) || _die "Failed to create backup"
|
||||
rm -f "${DATA_PATH}/database.sql"
|
||||
|
||||
# Restart containers
|
||||
docker compose start
|
||||
docker compose -p "${CONTAINER_NAME}" start
|
||||
|
||||
echo "Backup created successfully"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Service settings specific to this server
|
||||
# Service identification (REQUIRED)
|
||||
# CONTAINER_NAME must be unique per instance if running multiple Seafile services
|
||||
# It's used for container names, network name, and project identification
|
||||
CONTAINER_NAME=seafile
|
||||
IMAGE_TAG="12.0-latest"
|
||||
|
||||
@@ -6,6 +8,7 @@ IMAGE_TAG="12.0-latest"
|
||||
SSH_USER="root"
|
||||
|
||||
# Data path on host for persistent storage
|
||||
# Must be unique per instance if running multiple Seafile services
|
||||
DATA_PATH="/home/dropshell/seafile"
|
||||
|
||||
# Seafile server configuration
|
||||
|
||||
@@ -14,7 +14,7 @@ echo "This includes all files, database, and configuration!"
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Stop and remove containers
|
||||
docker compose down -v 2>/dev/null || true
|
||||
docker compose -p "${CONTAINER_NAME}" down -v 2>/dev/null || true
|
||||
|
||||
# Remove data directory
|
||||
rm -rf "${DATA_PATH}"
|
||||
|
||||
@@ -13,12 +13,16 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- seafile-net
|
||||
|
||||
memcached:
|
||||
image: memcached:1.6-alpine
|
||||
container_name: ${CONTAINER_NAME}_memcached
|
||||
restart: unless-stopped
|
||||
entrypoint: memcached -m 256
|
||||
networks:
|
||||
- seafile-net
|
||||
|
||||
seafile:
|
||||
image: ${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG}
|
||||
@@ -41,3 +45,9 @@ services:
|
||||
SEAFILE_SERVER_HOSTNAME: ${SEAFILE_SERVER_HOSTNAME}
|
||||
SEAFILE_SERVER_LETSENCRYPT: "false"
|
||||
TIME_ZONE: ${TZ}
|
||||
networks:
|
||||
- seafile-net
|
||||
|
||||
networks:
|
||||
seafile-net:
|
||||
name: ${CONTAINER_NAME}_net
|
||||
|
||||
@@ -16,13 +16,13 @@ export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Pull images
|
||||
docker compose pull || _die "Failed to pull images"
|
||||
docker compose -p "${CONTAINER_NAME}" pull || _die "Failed to pull images"
|
||||
|
||||
# Stop existing containers
|
||||
docker compose down 2>/dev/null || true
|
||||
docker compose -p "${CONTAINER_NAME}" down 2>/dev/null || true
|
||||
|
||||
# Start containers
|
||||
docker compose up -d || _die "Failed to start containers"
|
||||
docker compose -p "${CONTAINER_NAME}" up -d || _die "Failed to start containers"
|
||||
|
||||
echo "Installation of ${CONTAINER_NAME} complete"
|
||||
echo "Access Seafile at ${SEAFILE_SERVER_PROTOCOL}://${SEAFILE_SERVER_HOSTNAME}:${HTTP_PORT}"
|
||||
|
||||
@@ -12,5 +12,5 @@ cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
echo "Container ${CONTAINER_NAME} logs:"
|
||||
_grey_start
|
||||
docker compose logs "$@"
|
||||
docker compose -p "${CONTAINER_NAME}" logs "$@"
|
||||
_grey_end
|
||||
|
||||
8
seafile/ports.sh
Executable file
8
seafile/ports.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "HTTP_PORT"
|
||||
|
||||
# PORTS SCRIPT
|
||||
# Lists the exposed ports
|
||||
|
||||
echo "$HTTP_PORT"
|
||||
@@ -13,14 +13,14 @@ export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Stop and remove containers before restore
|
||||
docker compose down
|
||||
docker compose -p "${CONTAINER_NAME}" down
|
||||
|
||||
# Restore files using dropshell's restore system
|
||||
# shellcheck disable=SC2046
|
||||
restore_items $(get_seafile_volumes) || _die "Failed to restore data from backup file"
|
||||
|
||||
# Start database container only
|
||||
docker compose up -d db
|
||||
docker compose -p "${CONTAINER_NAME}" up -d db
|
||||
echo "Waiting for database to be ready..."
|
||||
sleep 10
|
||||
|
||||
@@ -36,6 +36,6 @@ else
|
||||
fi
|
||||
|
||||
# Start all containers
|
||||
docker compose up -d
|
||||
docker compose -p "${CONTAINER_NAME}" up -d
|
||||
|
||||
echo "Restore complete! Service is running."
|
||||
|
||||
@@ -9,7 +9,7 @@ export MYSQL_ROOT_PASSWORD DB_PASSWORD SEAFILE_ADMIN_EMAIL SEAFILE_ADMIN_PASSWOR
|
||||
export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
|
||||
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
docker compose up -d || _die "Failed to start containers"
|
||||
docker compose -p "${CONTAINER_NAME}" up -d || _die "Failed to start containers"
|
||||
|
||||
echo "Container ${CONTAINER_NAME} started"
|
||||
echo "Access Seafile at ${SEAFILE_SERVER_PROTOCOL}://${SEAFILE_SERVER_HOSTNAME}:${HTTP_PORT}"
|
||||
|
||||
@@ -9,6 +9,6 @@ export MYSQL_ROOT_PASSWORD DB_PASSWORD SEAFILE_ADMIN_EMAIL SEAFILE_ADMIN_PASSWOR
|
||||
export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
|
||||
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
docker compose stop || _die "Failed to stop containers"
|
||||
docker compose -p "${CONTAINER_NAME}" stop || _die "Failed to stop containers"
|
||||
|
||||
echo "Container ${CONTAINER_NAME} stopped"
|
||||
|
||||
@@ -11,10 +11,10 @@ export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Stop and remove containers (but preserve volumes/data)
|
||||
docker compose down || _die "Failed to stop containers"
|
||||
docker compose -p "${CONTAINER_NAME}" down || _die "Failed to stop containers"
|
||||
|
||||
# Remove images
|
||||
docker compose config --images | xargs -r docker rmi 2>/dev/null || true
|
||||
docker compose -p "${CONTAINER_NAME}" config --images | xargs -r docker rmi 2>/dev/null || true
|
||||
|
||||
echo "Uninstallation of ${CONTAINER_NAME} complete."
|
||||
echo "Data preserved in ${DATA_PATH}. To remove all data, use destroy.sh"
|
||||
|
||||
Reference in New Issue
Block a user