edited read e=me

This commit is contained in:
heyethereum
2024-08-13 02:31:18 +08:00
parent 7bb5d7a822
commit bd41e02b26

View File

@@ -20,4 +20,60 @@ 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.