From bd41e02b262f3c26db5f36becd96380b36e717af Mon Sep 17 00:00:00 2001 From: heyethereum Date: Tue, 13 Aug 2024 02:31:18 +0800 Subject: [PATCH] edited read e=me --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 403c1fe..153377e 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,60 @@ To run the Docker container from the image, use the following command: ```bash docker run -d -p 8000:8000 safeqr-fastapi-app -``` \ No newline at end of file +``` + +This will start the FastAPI application in a Docker container, making it accessible at `http://localhost:8000`. + +## Stop/Kill the Docker Container + +To stop the running container, first, find the container ID: + +```bash +docker ps +``` + +This command lists all running containers. Find the `CONTAINER ID` for `safeqr-fastapi-app`. + +To stop the container, use: + +```bash +docker stop +``` + +Replace `` with the actual ID of your container. + +If you want to remove the container entirely after stopping it: + +```bash +docker rm +``` + +## Accessing the Application Logs + +If you need to view the logs of the running container, use: + +```bash +docker logs +``` + +## Removing the Docker Image + +If you need to remove the Docker image, use the following command: + +```bash +docker rmi safeqr-fastapi-app +``` + +This will remove the Docker image from your local machine. + +## Troubleshooting + +- **Port Conflict**: If port 8000 is already in use, you can change the port mapping. For example, to map the container's port 8000 to port 8080 on your machine, use: + + ```bash + docker run -d -p 8080:8000 safeqr-fastapi-app + ``` + +- **Container Already Running**: If you get an error that the container is already running, stop the existing container as shown above. + +