59 lines
1.2 KiB
Markdown
59 lines
1.2 KiB
Markdown
# Docker Web Application
|
|
|
|
## Prerequisites
|
|
- Docker installed on the system.
|
|
|
|
## Application Description
|
|
This is a simple Flask web application running inside a Docker container. The app accepts user input via a form and displays the submitted data.
|
|
|
|
## Docker Setup
|
|
|
|
1. **Preparation**
|
|
Run the following command to set up the environment:
|
|
```bash
|
|
./prepare-app.sh
|
|
```
|
|
|
|
2. **Start the Application**
|
|
Start the application with:
|
|
```bash
|
|
./start-app.sh
|
|
```
|
|
The app will be available at: [http://localhost:5000](http://localhost:5000)
|
|
|
|
3. **Stop the Application**
|
|
To stop the application:
|
|
```bash
|
|
./stop-app.sh
|
|
```
|
|
|
|
4. **Remove the Application**
|
|
To remove all Docker containers, networks, and volumes:
|
|
```bash
|
|
./remove-app.sh
|
|
```
|
|
|
|
## Working Example
|
|
1. Prepare the application:
|
|
```bash
|
|
./prepare-app.sh
|
|
```
|
|
2. Start the app:
|
|
```bash
|
|
./start-app.sh
|
|
```
|
|
3. Visit [http://localhost:5000](http://localhost:5000) in a browser.
|
|
|
|
4. Stop the app:
|
|
```bash
|
|
./stop-app.sh
|
|
```
|
|
|
|
5. Remove the app:
|
|
```bash
|
|
./remove-app.sh
|
|
```
|
|
|
|
## Conclusion
|
|
This application demonstrates Docker containerization of a Flask app with basic form handling.
|