mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-19 07:18:06 +02:00
Fix default port mapping and indentation
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
This commit is contained in:
parent
dc1bb13dce
commit
77c6920a83
20 changed files with 111 additions and 108 deletions
|
@ -19,14 +19,14 @@ services:
|
|||
web:
|
||||
build: angular
|
||||
ports:
|
||||
- 80:4200
|
||||
- 4200:4200
|
||||
...
|
||||
|
||||
```
|
||||
The compose file defines an application with one service `angular`. The image for the service is built with the Dockerfile inside the `angular` directory (build parameter).
|
||||
|
||||
When deploying the application, docker-compose maps the container port 4200 to port 80 of the host as specified in the file.
|
||||
Make sure port 80 is not being used by another container, otherwise the port should be changed.
|
||||
When deploying the application, docker-compose maps the container port 4200 to the same port on the host as specified in the file.
|
||||
Make sure port 4200 is not being used by another container, otherwise the port should be changed.
|
||||
|
||||
|
||||
## Deploy with docker-compose
|
||||
|
@ -53,11 +53,11 @@ Listing containers must show a container running and the port mapping as below:
|
|||
```
|
||||
$ docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
6884c228388e angular_web "docker-entrypoint.s…" 42 seconds ago Up 36 seconds 0.0.0.0:80->4200/tcp angular_web_1
|
||||
6884c228388e angular_web "docker-entrypoint.s…" 42 seconds ago Up 36 seconds 0.0.0.0:4200->4200/tcp angular_web_1
|
||||
|
||||
```
|
||||
|
||||
After the application starts, navigate to `http://localhost:80` in your web browser.
|
||||
After the application starts, navigate to `http://localhost:4200` in your web browser.
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ services:
|
|||
web:
|
||||
build: angular
|
||||
ports:
|
||||
- 80:4200
|
||||
- 4200:4200
|
||||
volumes:
|
||||
- ./angular:/project
|
||||
- /project/node_modules
|
||||
- ./angular:/project
|
||||
- /project/node_modules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue