edited read e=me
This commit is contained in:
56
README.md
56
README.md
@@ -21,3 +21,59 @@ To run the Docker container from the image, use the following command:
|
|||||||
```bash
|
```bash
|
||||||
docker run -d -p 8000:8000 safeqr-fastapi-app
|
docker run -d -p 8000:8000 safeqr-fastapi-app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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 <container_id>
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `<container_id>` with the actual ID of your container.
|
||||||
|
|
||||||
|
If you want to remove the container entirely after stopping it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker rm <container_id>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Accessing the Application Logs
|
||||||
|
|
||||||
|
If you need to view the logs of the running container, use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker logs <container_id>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user