-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
# P3-BM-dashboard | ||
#### Run docker in production | ||
docker compose --profile prod up --build | ||
|
||
- "prod" is the profile which runs the backend in docker. | ||
- spring-boot run does not run the backend in docker. It skips building. | ||
- --build forces a new build. | ||
## Running the backend (developing) | ||
1. Enter the backend directory with `cd /backend` | ||
2. Run the application with `mvn spring-boot:run` | ||
- Spring boot will run "docker compose up" with the "frontend" profile. | ||
- This will launch a `mongodb` database container | ||
3. Stop the application by exiting the terminal, or issuing `mvn spring-boot:stop` | ||
|
||
## Building and running with Docker Compose | ||
1. Enter the projects root directory | ||
2. Use `docker compose up --build` | ||
- This will force a `--build` instead of pulling. | ||
- Docker compose will **built** and start a `spring-boot` container. | ||
- Docker compose will **pull** and start the `mongodb` container. | ||
3. Use `docker compose down` to stop the containers together. |