Skip to content

A self-hosted media server and file management system

Docker setup scripts

aminnausin5ceeb51e7557
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 4ceb7810..a1aed97e 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -91,8 +91,6 @@ services:
- '8080'
depends_on:
- app
- environment:
- - APP_HOST=${APP_HOST}
networks:
- docker-network
db:
diff --git a/docker/.env.docker b/docker/.env.docker
new file mode 100644
index 00000000..d4efb8b3
--- /dev/null
+++ b/docker/.env.docker
@@ -0,0 +1,8 @@
+APP_SCHEME=http
+APP_HOST=app.test
+APP_PORT=8080
+
+DB_HOST=db
+DB_PORT=5432
+DB_USERNAME=postgres
+DB_PASSWORD=root
diff --git a/startDocker.bat b/startDocker.bat
new file mode 100644
index 00000000..83d4bcd7
--- /dev/null
+++ b/startDocker.bat
@@ -0,0 +1,47 @@
+@echo off
+echo Checking required files and folders...
+
+:: Ensure .docker-compose.yaml exists -> Holds app setup
+if not exist .docker-compose.yaml(
+ echo ❌ ERROR: Missing docker compose file
+ echo ➡️ Please download this file before running Docker.
+ exit /b 1
+)
+
+:: Ensure app.conf exists -> Holds nginx config
+if not exist "docker/nginx/app.conf" (
+ echo ❌ ERROR: Missing docker/nginx/app.conf
+ echo ➡️ Please download this file before running Docker.
+ exit /b 1
+) else (
+ echo ✅ Found nginx config
+ echo Make sure to replace 'app.test' with your website URL in 'docker/nginx/app.conf' if you have one
+)
+
+:: Ensure .env.docker exists -> Holds default environment variables
+if not exist "docker/.env.docker"(
+ echo ❌ ERROR: Missing ./docker/.env.docker
+ echo ➡️ Please download this file before running Docker.
+ exit /b 1
+) else (
+ echo ✅ Found environment variables
+)
+
+:: Ensure .env exists
+if not exist .env (
+ echo ⚠️ .env file not found! Creating from .env.docker...
+ copy docker/.env.docker .env
+ echo ✅ .env file created.
+)
+
+:: Ensure the ./data directory exists -> Holds user media
+if not exist "data" (
+ echo ⚠️ Missing ./data directory...
+ mkdir data
+ echo ✅ ./data directory created.
+) else (
+ echo ✅ Found ./data directory
+)
+
+echo ✅ Setup complete
+docker-compose up
diff --git a/startDocker.sh b/startDocker.sh
new file mode 100644
index 00000000..6ad6ff1c
--- /dev/null
+++ b/startDocker.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Ensure the script is executed in the project root
+cd "$(dirname "$0")"
+
+echo "🔹 Checking required files and folders..."
+
+# Ensure .docker-compose.yaml exists -> Holds app setup
+if [ ! -f ".docker-compose.yaml" ]; then
+ echo "❌ ERROR: Missing docker compose file"
+ echo "➡️ Please download this file before running Docker."
+ exit 1
+fi
+
+# Ensure app.conf exists
+if [ ! -f "./docker/nginx/app.conf" ]; then
+ echo "❌ ERROR: Missing ./docker/nginx/app.conf"
+ echo "➡️ Please download this file before running Docker."
+ exit 1
+else
+ echo "✅ Found nginx config"
+ echo "Make sure to replace 'app.test' with your website URL in 'docker/nginx/app.conf' if you have one"
+fi
+
+# Ensure app.conf exists
+if [ ! -f "./docker/.env.docker" ]; then
+ echo "❌ ERROR: Missing ./docker/.env.docker"
+ echo "➡️ Please download this file before running Docker."
+ exit 1
+else
+ echo "✅ Found environment variables"
+fi
+
+# Check if .env exists, otherwise create it from .env.example
+if [ ! -f ".env" ]; then
+ echo "⚠️ .env file not found! Creating from .env.docker..."
+ cp ./docker/.env.docker .env
+ echo "✅ .env file created."
+fi
+
+# Ensure the ./data directory exists
+if [ ! -d "./data" ]; then
+ echo "⚠️ Missing ./data directory! Creating it..."
+ mkdir -p ./data
+ echo "✅ ./data directory created."
+else
+ echo "✅ Found ./data directory"
+fi
+
+echo "✅ Setup complete"
+docker-compose up