A simple Flask application that displays a welcome message on the landing page. This app can be run locally with Python or containerized with Docker.
- Simple Flask web application with a welcome page
- Responsive HTML design with CSS styling
- Multiple deployment options (local, Docker)
- Python 3.8+ (for local development)
- Docker (for containerized deployment)
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Open your browser and navigate to
http://localhost:8080
- Build the Docker image:
docker build -t flask-welcome-app .
- Run the container:
docker run -d -p 8080:8080 --name flask-app flask-welcome-app
- Access the application at
http://localhost:8080
- Stop the container:
docker stop flask-app - Remove the container:
docker rm flask-app - View logs:
docker logs flask-app
- Stop and remove the container:
docker stop flask-app
docker rm flask-app
- Remove the Docker image (optional):
docker rmi flask-welcome-app
- Or do it all in one command:
docker stop flask-app && docker rm flask-app && docker rmi flask-welcome-app
.
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── .dockerignore # Docker ignore file
└── README.md # This file
The application uses the following default configuration:
- Host:
0.0.0.0(all interfaces) - Port:
8080 - Debug:
True(local),False(production)
Edit the HTML content in the welcome() function in app.py to customize the welcome message and styling.
Add new routes to app.py:
@app.route('/about')
def about():
return '<h1>About Page</h1>'
For different environments, consider using environment variables:
import os
app.config['DEBUG'] = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'
- Ensure Python 3.8+ is installed
- Check if port 8080 is available
- Verify all dependencies are installed
- Ensure Docker is running
- Check if port 8080 is available on host
- View container logs:
docker logs flask-app
- Use environment variables for configuration
- Implement proper logging
- Add health check endpoints
- Use HTTPS with SSL certificates
- Implement proper error handling
- Add monitoring and alerting
- Use a proper database for data persistence
- Implement CI/CD pipeline for deployments
This project is open source and available under the MIT License.