Skip to content

Commit 1022b7c

Browse files
K11E3Ryanglbme
authored andcommitted
Docker File added
need transalation for README
1 parent d3af566 commit 1022b7c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README_EN.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,46 @@ This project contains solutions for problems from LeetCode, "Coding Interviews (
2222

2323
https://doocs.github.io/leetcode
2424

25+
## Using Docker
26+
27+
To facilitate the setup and usage of the project, you can use Docker. Below are the instructions to build and run the Docker container.
28+
29+
### Prerequisites
30+
31+
- Install [Docker](https://docs.docker.com/get-docker/).
32+
33+
### Building the Docker Image
34+
35+
Navigate to the root directory of the project and build the Docker image using the following command:
36+
37+
```sh
38+
docker build -t leetcode-solutions .
39+
```
40+
41+
### Running the Docker Container
42+
43+
Once the image is built, you can run the container with the following command:
44+
45+
```sh
46+
docker run -it --rm leetcode-solutions
47+
```
48+
49+
This command will start a container and open an interactive shell session where you can work with the project.
50+
51+
### Accessing Project Files
52+
53+
To access project files from within the Docker container, you can mount the project directory as a volume. Use the following command:
54+
55+
```sh
56+
docker run -it --rm -v $(pwd):/app leetcode-solutions
57+
```
58+
59+
This command mounts the current directory (where you run the command) to the `/app` directory in the container, allowing you to access and modify files as needed.
60+
61+
### Stopping the Docker Container
62+
63+
To stop the Docker container, you can use the `exit` command or press `Ctrl + D` in the terminal where the container is running.
64+
2565
## Solutions
2666

2767
- [LeetCode](/solution/README_EN.md)

0 commit comments

Comments
 (0)