jknapp eaeb64c3ed
All checks were successful
WHP Default Container / Build-and-Push (push) Successful in 11s
Initial setup: Web hosting default container with auto-landing page
- Added Dockerfile with Apache base image
- Created beautiful web hosting landing page (index.html)
- Added startup script to check for content and copy default page
- Set up Gitea workflow for automatic builds
- Updated README with comprehensive documentation

The container automatically provides a professional landing page when the web directory is empty, focusing on web hosting features and guiding users to configure their site through the Web Hosting Panel.
2025-07-12 11:03:43 -07:00

27 lines
790 B
Bash
Executable File

#!/bin/sh
# Default web directory for Apache
WEB_DIR="/usr/local/apache2/htdocs"
echo "Starting web server initialization..."
# Check if web directory exists, create if it doesn't
if [ ! -d "$WEB_DIR" ]; then
echo "Creating web directory: $WEB_DIR"
mkdir -p "$WEB_DIR"
fi
# Check if web directory is empty (no files or only hidden files)
if [ -z "$(ls -A "$WEB_DIR" 2>/dev/null | grep -v '^\.')" ]; then
echo "Web directory is empty. Copying default landing page..."
cp /index.html "$WEB_DIR/"
echo "Default landing page copied successfully."
else
echo "Web directory contains files. Skipping default page copy."
fi
echo "Starting Apache web server..."
echo "Server will be available at: http://localhost:80"
# Start Apache in foreground
exec httpd-foreground