-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: [#351] fix single-command to run demo env with docker
- Loading branch information
1 parent
3f367c6
commit 9a88846
Showing
6 changed files
with
88 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Single command to setup and run the tracker using the pre-built image. | ||
|
||
# Check if 'storage' directory exists | ||
if [ -d "./storage" ]; then | ||
echo "Warning: 'storage' directory already exists. Please remove or rename it before proceeding." | ||
exit 1 | ||
fi | ||
|
||
# Check if 'config.toml' file exists in the current directory | ||
if [ -f "./config.toml" ]; then | ||
echo "Warning: 'config.toml' file already exists in the root directory. Please remove or rename it before proceeding." | ||
exit 1 | ||
fi | ||
|
||
# Check if SQLite3 is installed | ||
if ! command -v sqlite3 &> /dev/null; then | ||
echo "Warning: SQLite3 is not installed on your system. Please install it and retry." | ||
exit 1 | ||
fi | ||
|
||
wget https://raw.githubusercontent.com/torrust/torrust-tracker/v3.0.0-alpha.3/config.toml.local -O config.toml \ | ||
&& mkdir -p ./storage/database \ | ||
&& mkdir -p ./storage/ssl_certificates \ | ||
&& touch ./storage/database/data.db \ | ||
&& echo ";" | sqlite3 ./storage/database/data.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
TORRUST_TRACKER_USER_UID=${TORRUST_TRACKER_USER_UID:-1000} | ||
TORRUST_TRACKER_CONFIG=$(cat config.toml) | ||
|
||
docker run -it \ | ||
--user="$TORRUST_TRACKER_USER_UID" \ | ||
--publish 6969:6969/udp \ | ||
--publish 7070:7070/tcp \ | ||
--publish 1212:1212/tcp \ | ||
--env TORRUST_TRACKER_CONFIG="$TORRUST_TRACKER_CONFIG" \ | ||
--volume "$(pwd)/storage":"/app/storage" \ | ||
torrust/tracker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters