Skip to content

Commit 94b59ac

Browse files
committed
chore: update docker-reamde.md with latest instructions
1 parent 2d2bad1 commit 94b59ac

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

Docker-README.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
# Docker: Build and run
1+
# Inventory Management Tool - Docker Setup
22

3-
This project is a Spring Boot application. The repository includes a multi-stage `Dockerfile` that builds the app with Maven and produces a runtime image. A `docker-compose.yml` is provided as an example to run the service together with a MySQL database.
3+
This project is a Spring Boot application. The repository includes a multi-stage `Dockerfile` that builds the app with Maven and produces a runtime image. A `docker-compose.yml` is provided to run the service together with a MySQL database.
44

5-
Quick steps
5+
---
66

7-
Build the image with Docker (from repository root):
7+
## Quick Commands
88

99
```bash
10+
# Build Docker image
1011
docker build -t im-app:latest .
11-
```
1212

13-
Run the image:
14-
15-
```bash
16-
docker run --rm -p 8080:8080 \
17-
-e SPRING_DATASOURCE_URL='jdbc:mysql://<host>:3306/imdb' \
13+
# Run the Docker image
14+
docker run --rm -p 8082:8082 \
15+
-e SPRING_DATASOURCE_URL='jdbc:mysql://<host>:3306/inventory_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC' \
1816
-e SPRING_DATASOURCE_USERNAME=root \
19-
-e SPRING_DATASOURCE_PASSWORD=example \
17+
-e SPRING_DATASOURCE_PASSWORD=Anjana@3176 \
2018
im-app:latest
21-
```
22-
23-
Use docker-compose for local development (builds image and starts MySQL):
2419

25-
```bash
20+
# Start using Docker Compose
2621
docker compose up --build
27-
```
2822

29-
Notes
30-
- The Dockerfile uses Maven to build and OpenJDK 21 runtime to run the jar.
31-
- The `docker-compose.yml` exposes MySQL on 3306 for convenience. In production you should not expose DB ports publicly and use secure credentials.
32-
- If you want Docker image layers to cache better during development, consider copying only `pom.xml` first and running `mvn dependency:go-offline` before copying source.
23+
# Stop Docker Compose
24+
docker compose down
25+
26+
# View logs
27+
docker compose logs -f

0 commit comments

Comments
 (0)