1- # Docker Container Setup - Simplified Documentation
1+ # Docker Container Setup - Beginner-Friendly Guide
22
3- This guide explains how to set up and run the Recode Hive website using Docker.
3+ This guide explains how to set up and run the Recode Hive website using Docker in the simplest way possible .
44
55## Prerequisites
66
77- Install [ Docker] ( https://docs.docker.com/engine/install/ ) .
8- - (Optional) Install Docker Compose for easier multi-container management .
8+ - Install Docker Compose (usually included with Docker Desktop) .
99
1010## Steps
1111
12- ### 1. Build and Run with Docker Compose (Recommended)
12+ ### 1. Start the Application with Docker Compose
1313
14- Using Docker Compose simplifies the setup process. Run the following command in the project root directory:
14+ The easiest way to run the application is by using Docker Compose. Simply run the following command in the project root directory:
1515
1616``` bash
1717docker-compose up --build
@@ -22,29 +22,36 @@ This command will:
2222- Start the container.
2323- Map port ` 3000 ` from the container to your local machine.
2424
25- Visit [ http://localhost:3000 ] ( http://localhost:3000 ) to view the site.
25+ Once the setup is complete, visit [ http://localhost:3000 ] ( http://localhost:3000 ) to view the site.
2626
27- ### 2. Manual Setup with Docker (Optional)
27+ ### 2. Stop the Application
2828
29- If you prefer not to use Docker Compose, follow these steps :
29+ To stop the application, press ` Ctrl+C ` in the terminal where the application is running. Then, remove the containers with :
3030
31- #### a. Build the Docker Image
3231``` bash
33- docker build -t recodehive-app .
32+ docker-compose down
3433```
3534
36- #### b. Run the Docker Container
37- ``` bash
38- docker run -p 3000:3000 recodehive-app
39- ```
35+ ### 3. Debugging Tips
4036
41- Visit [ http://localhost:3000 ] ( http://localhost:3000 ) to view the site.
37+ - ** View Logs:** If you encounter issues, check the container logs:
38+ ``` bash
39+ docker-compose logs
40+ ```
41+ - ** Rebuild the Image:** If you make changes to the code, rebuild the image:
42+ ``` bash
43+ docker-compose up --build
44+ ```
45+ - ** Access the Container Shell:** To debug inside the container:
46+ ``` bash
47+ docker exec -it < container_name> sh
48+ ```
4249
43- ## Notes
50+ ### Notes
4451
45- - Ensure the ` Dockerfile ` and ` docker-compose.yml ` are correctly configured.
52+ - The ` docker-compose.yml ` file is pre- configured for development .
4653- The application is set to bind to ` 0.0.0.0 ` for external access.
47- - Use ` docker logs <container_id> ` to debug any issues .
54+ - File changes on your local machine will automatically reflect in the container (hot-reloading enabled) .
4855
4956For more details, refer to the official Docker documentation.
5057
0 commit comments