You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,53 @@ With this setup, the API ensures efficient and reliable data handling and routin
48
48
49
49
Ensure MySQL is running and create a database forthe application. Update the database credentialsin the environment variables.
50
50
51
+
4. **Set Environment Variables:**
52
+
53
+
Create a `.env` file in the root directory of the project and add the following environment variables:
54
+
55
+
```sh
56
+
DB_HOST=localhost
57
+
DB_PORT=3306
58
+
DB_USER=root
59
+
DB_PASSWORD=yourpassword
60
+
DB_NAME=yourdatabase
61
+
```
62
+
63
+
5. **Docker Setup:**
64
+
65
+
This project includes Docker files to set up the entire stack easily. Ensure you have Docker installed on your machine.
66
+
67
+
- **Build the Docker image:**
68
+
69
+
```sh
70
+
docker build -t rest-api .
71
+
```
72
+
73
+
- **Run the Docker container:**
74
+
75
+
```sh
76
+
docker run -d -p 8080:8080 --env-file .env rest-api
77
+
```
78
+
79
+
6. **Docker Compose Setup:**
80
+
81
+
This project includes a `docker-compose.yml` file to set up the entire stack, including MySQL, easily. Ensure you have Docker and Docker Compose installed on your machine.
82
+
83
+
- **Update the `.env` file to use the MySQL container:**
0 commit comments