Skip to content

Commit

Permalink
Change port number in spring-postgresql sample (docker#41)
Browse files Browse the repository at this point in the history
Signed-off-by: alain <alain@localhost.localdomain>
  • Loading branch information
sellerin authored Apr 8, 2020
1 parent 3a0f551 commit 9c21b12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spring-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ services:
backend:
build: backend
ports:
- 80:8080
- 8080:8080
db:
image: postgres
...
```
The compose file defines an application with two services `backend` and `db`.
When deploying the application, docker-compose maps port 8080 of the backend service container to port 80 of the host as specified in the file.
Make sure port 80 on the host is not already being in use.
When deploying the application, docker-compose maps port 8080 of the backend service container to port 8080 of the host as specified in the file.
Make sure port 8080 on the host is not already being in use.

## Deploy with docker-compose

Expand All @@ -52,12 +52,12 @@ Listing containers must show two containers running and the port mapping as belo
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
56236f640eaa postgres "docker-entrypoint.s…" 29 seconds ago Up 28 seconds 5432/tcp spring-postgres_db_1
6e69472dc2c0 spring-postgres_backend "java -Djava.securit…" 29 seconds ago Up 28 seconds 0.0.0.0:80->8080/tcp spring-postgres_backend_1
6e69472dc2c0 spring-postgres_backend "java -Djava.securit…" 29 seconds ago Up 28 seconds 0.0.0.0:8080->8080/tcp spring-postgres_backend_1
```

After the application starts, navigate to `http://localhost:80` in your web browse or run:
After the application starts, navigate to `http://localhost:8080` in your web browse or run:
```
$ curl localhost:80
$ curl localhost:8080
<!DOCTYPE HTML>
<html>
<head>
Expand Down

0 comments on commit 9c21b12

Please sign in to comment.