Initial setup: Web hosting default container with auto-landing page
All checks were successful
WHP Default Container / Build-and-Push (push) Successful in 11s
All checks were successful
WHP Default Container / Build-and-Push (push) Successful in 11s
- 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.
This commit is contained in:
27
scripts/startup.sh
Executable file
27
scripts/startup.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
Reference in New Issue
Block a user