Compare commits
No commits in common. "0a3e744ca914264dab9aa9a0ca77a3014120d7e5" and "31a78678a192691a66ee070b90cc140e94aa6f4d" have entirely different histories.
0a3e744ca9
...
31a78678a1
|
|
@ -3,16 +3,18 @@ services:
|
|||
image: mariadb:10.11
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# --- REPLACE THESE NOW ---
|
||||
MYSQL_ROOT_PASSWORD: SuperSecretRoot123!
|
||||
MYSQL_DATABASE: filerun
|
||||
MYSQL_USER: filerun
|
||||
MYSQL_PASSWORD: SuperSecretFileRun456!
|
||||
# ------------------------
|
||||
volumes:
|
||||
- ./db_data:/var/lib/mysql
|
||||
networks:
|
||||
- internal
|
||||
|
||||
filerun:
|
||||
ffilerun:
|
||||
image: filerun/filerun:8.1.arm64v8
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
|
@ -21,53 +23,35 @@ services:
|
|||
FR_DB_NAME: filerun
|
||||
FR_DB_USER: filerun
|
||||
FR_DB_PASS: SuperSecretFileRun456!
|
||||
|
||||
APACHE_RUN_USER: www-data
|
||||
APACHE_RUN_USER_ID: 33
|
||||
APACHE_RUN_GROUP: www-data
|
||||
APACHE_RUN_GROUP_ID: 33
|
||||
|
||||
# Critical: enable proxy support in FileRun!
|
||||
FR_USE_PROXY: "true"
|
||||
|
||||
volumes:
|
||||
- ./filerun_html:/var/www/html
|
||||
- ./user_data:/user-files
|
||||
expose:
|
||||
- "80" # TO MORA BITI TUKAJ!
|
||||
networks:
|
||||
- internal
|
||||
- traefik_default
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=traefik_default"
|
||||
|
||||
# Create redirect middleware to HTTPS
|
||||
- "traefik.http.middlewares.filerun-redirect.redirectscheme.scheme=https"
|
||||
- "traefik.http.middlewares.filerun-redirect.redirectscheme.permanent=true"
|
||||
|
||||
# FileRun headers (required behind proxy)
|
||||
- "traefik.http.middlewares.filerun-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
|
||||
- "traefik.http.middlewares.filerun-headers.headers.customrequestheaders.X-Forwarded-Host=filerun.rozic-dev.com"
|
||||
|
||||
# HTTP Router → redirect to HTTPS
|
||||
- "traefik.http.middlewares.filerun-headers.headers.customresponseheaders.X-Forwarded-Proto=https"
|
||||
- "traefik.http.routers.filerun-http.entrypoints=web"
|
||||
- "traefik.http.routers.filerun-http.rule=Host(`filerun.rozic-dev.com`)"
|
||||
- "traefik.http.routers.filerun-http.middlewares=filerun-redirect@docker"
|
||||
|
||||
# HTTPS Router
|
||||
- "traefik.http.routers.filerun-http.middlewares=redirectscheme"
|
||||
- "traefik.http.middlewares.redirectscheme.redirectscheme.scheme=https"
|
||||
- "traefik.http.routers.filerun-https.entrypoints=websecure"
|
||||
- "traefik.http.routers.filerun-https.rule=Host(`filerun.rozic-dev.com`)"
|
||||
- "traefik.http.routers.filerun-https.tls=true"
|
||||
- "traefik.http.routers.filerun-https.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.routers.filerun-https.middlewares=filerun-headers@docker"
|
||||
|
||||
# Backend service
|
||||
- "traefik.http.routers.filerun-https.middlewares=filerun-headers"
|
||||
- "traefik.http.routers.filerun-https.priority=100"
|
||||
- "traefik.http.services.filerun.loadbalancer.server.port=80"
|
||||
|
||||
networks:
|
||||
internal:
|
||||
driver: bridge
|
||||
traefik_default:
|
||||
external: true
|
||||
external: true # This connects to your existing Traefik network
|
||||
94
install.sh
94
install.sh
|
|
@ -1,94 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# --- Configuration ---
|
||||
# File name of the FileRun distribution ZIP archive
|
||||
FILERUN_ZIP="FileRun-2024.1.2-PHP-8.1.zip"
|
||||
# Directories used for persistent data and code
|
||||
DATA_DIRS=("db_data" "filerun_html" "user_data")
|
||||
# UID and GID for the www-data user inside the FileRun container (from docker-compose.yml)
|
||||
CONTAINER_UID_GID="33:33"
|
||||
# Temporary directory for extraction
|
||||
TEMP_DIR="./temp_filerun_extract"
|
||||
# ---------------------
|
||||
|
||||
echo "--- FileRun Installation Script ---"
|
||||
|
||||
# --- 1. Create and prepare directories ---
|
||||
echo "1. Creating and ensuring directories exist..."
|
||||
for dir in "${DATA_DIRS[@]}"; do
|
||||
if [ ! -d "$dir" ]; then
|
||||
echo " -> Creating directory: ${dir}/"
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
# --- 2. Unzip FileRun distribution and move files ---
|
||||
if [ -f "${FILERUN_ZIP}" ]; then
|
||||
echo "2. Unzipping ${FILERUN_ZIP} into a temporary folder and moving contents to ./filerun_html..."
|
||||
|
||||
# Create temporary directory for extraction
|
||||
mkdir -p "$TEMP_DIR"
|
||||
|
||||
# Unzip to temporary folder
|
||||
unzip -q "${FILERUN_ZIP}" -d "$TEMP_DIR"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ ERROR: Failed to unzip ${FILERUN_ZIP}. Check if 'unzip' is installed or if the file is corrupted."
|
||||
rm -rf "$TEMP_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Move contents from temp to final location (./filerun_html)
|
||||
mv "$TEMP_DIR"/* ./filerun_html/
|
||||
|
||||
# Clean up temporary directory
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
echo " [SUCCESS] Files extracted and moved to ./filerun_html."
|
||||
else
|
||||
echo "❌ ERROR: File not found: ${FILERUN_ZIP}. Please ensure it is in the current directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- 3. Set correct ownership for container user (33:33) ---
|
||||
echo "3. Setting ownership to ${CONTAINER_UID_GID} (www-data) for required FileRun paths..."
|
||||
|
||||
# 3a. Set ownership for the FileRun system data directory (mapped from /var/www/html/system/data)
|
||||
SYSTEM_DATA_PATH="./filerun_html/system/data"
|
||||
echo " -> Setting ownership for ${SYSTEM_DATA_PATH}/"
|
||||
sudo chown -R ${CONTAINER_UID_GID} "${SYSTEM_DATA_PATH}"
|
||||
|
||||
# 3b. Set ownership for the user files directory (mapped from /user-files)
|
||||
USER_DATA_PATH="./user_data"
|
||||
echo " -> Setting ownership for ${USER_DATA_PATH}/"
|
||||
sudo chown -R ${CONTAINER_UID_GID} "${USER_DATA_PATH}"
|
||||
|
||||
echo " [SUCCESS] Ownership set for application use."
|
||||
|
||||
# --- 4. Start Docker Compose services ---
|
||||
echo "4. Starting Docker services..."
|
||||
docker compose up -d
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ ERROR: Docker Compose failed to start services. Check your docker-compose.yml for errors."
|
||||
exit 1
|
||||
fi
|
||||
echo " [SUCCESS] Services started in detached mode."
|
||||
|
||||
# --- 5. Verify container status ---
|
||||
echo "5. Checking FileRun container status..."
|
||||
# Wait a few seconds for startup
|
||||
sleep 5
|
||||
CONTAINER_STATUS=$(docker compose ps -q filerun | xargs docker inspect --format '{{.State.Status}}')
|
||||
|
||||
if [ "$CONTAINER_STATUS" == "running" ]; then
|
||||
echo "✅ FileRun container is running."
|
||||
echo ""
|
||||
echo "--- NEXT STEPS ---"
|
||||
echo "FileRun is now accessible via Traefik at: https://filerun.rozic-dev.com"
|
||||
echo "If you still encounter a 'Database error', the application needs to run its initial setup."
|
||||
echo "1. Check the detailed application logs for the specific PHP error:"
|
||||
echo " docker compose logs filerun"
|
||||
echo "2. The database initialization (tables/schema) may take a moment."
|
||||
else
|
||||
echo "❌ WARNING: FileRun container status is '$CONTAINER_STATUS'. Check logs for details:"
|
||||
echo " docker compose logs filerun"
|
||||
fi
|
||||
Loading…
Reference in a new issue