This project demonstrates how to run a Flask web application and a Modbus server inside a Docker container.
- Docker
- Clone this repository.
- Navigate to the root directory of the project.
- Build the Docker image with the following command:
docker build -t my-app-image .
bash
- Run the Docker container with the following command:
docker run -d -i -t --privileged -p 80:80 -p 69:69 -p 502:502 -p 5000 --name my-app-container my-app-image
markdown
- The
-d
flag runs the container in the background. - The
-i
flag keeps stdin open even if not attached. - The
-t
flag allocates a pseudo-TTY. - The
--privileged
flag gives extended privileges to this container. - The
-p
flags map the container's ports to the host machine's ports. - The
--name
flag gives a name to the container.
- Access the web application by navigating to
http://localhost
in your web browser.
- Stop the Docker container with the following command:
docker stop my-app-container
bash
- Remove the Docker container with the following command:
docker rm my-app-container
markdown
- ketchup-