Skip to content

Commit

Permalink
new: add docker install version
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Nov 16, 2024
1 parent c811c69 commit 8c8cce8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions common/docker-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Check if Docker is installed, if not, install it
command -v docker &>/dev/null || curl -fsSL https://get.docker.com | sh

# Set the default tag if not provided
TAG=${1:-latest}

# Check if the 'hiddify-manager' folder exists
if [ -d "hiddify-manager" ]; then
echo 'Folder "hiddify-manager" already exists. Please change the directory to install with Docker.'
exit 1
fi

# Create the 'hiddify-manager' directory
mkdir hiddify-manager
cd hiddify-manager

# Download the docker-compose.yml file
wget https://raw.githubusercontent.com/hiddify/Hiddify-Manager/refs/heads/main/docker-compose.yml

# Generate random passwords for MySQL and Redis
mysqlpassword=$(openssl rand -base64 40)
redispassword=$(openssl rand -base64 40)

# Update docker-compose.yml with the specified tag and passwords
sed -i "s/hiddify-manager:latest/hiddify-manager:$TAG" docker-compose.yml
sed -i "s/REDIS_STRONG_PASS/$redispassword/g" docker-compose.yml
sed -i "s/MYSQL_STRONG_PASS/$mysqlpassword/g" docker-compose.yml

# Start the containers using Docker Compose
docker compose up -d

# Follow the logs from the containers
docker compose logs -f

0 comments on commit 8c8cce8

Please sign in to comment.