mirror of https://github.com/docker/compose.git
Merge pull request #104 from Gazler/documentation/port-strings
Documentation: Include notes on mapping ports
This commit is contained in:
commit
e6016bd5b4
|
@ -22,11 +22,14 @@ web:
|
|||
links:
|
||||
- db
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
- "49100:22"
|
||||
db:
|
||||
image: orchardup/postgresql
|
||||
```
|
||||
|
||||
**Note** When mapping ports in the format HOST:CONTAINER you may experience erroneous results when using a container port lower than 60. This is due to YAML parsing numbers in the format "xx:yy" as sexagesimal (base 60) for this reason it is recommended to define your port mappings as strings.
|
||||
|
||||
(No more installing Postgres on your laptop!)
|
||||
|
||||
Then type `fig up`, and Fig will start and run your entire app:
|
||||
|
|
|
@ -29,14 +29,14 @@ Simple enough. Finally, this is all tied together with a file called `fig.yml`.
|
|||
db:
|
||||
image: orchardup/postgresql
|
||||
ports:
|
||||
- 5432
|
||||
- "5432"
|
||||
web:
|
||||
build: .
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
links:
|
||||
- db
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
jekyll:
|
||||
build: .
|
||||
ports:
|
||||
- 4000:4000
|
||||
- "4000:4000"
|
||||
volumes:
|
||||
- .:/code
|
||||
environment:
|
||||
|
|
|
@ -21,7 +21,7 @@ web:
|
|||
links:
|
||||
- db
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
db:
|
||||
image: orchardup/postgresql
|
||||
```
|
||||
|
@ -107,7 +107,7 @@ We then define a set of services using `fig.yml`:
|
|||
build: .
|
||||
command: python app.py
|
||||
ports:
|
||||
- 5000:5000
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- .:/code
|
||||
links:
|
||||
|
|
|
@ -30,14 +30,14 @@ Finally, `fig.yml` is where the magic happens. It describes what services our ap
|
|||
db:
|
||||
image: orchardup/postgresql
|
||||
ports:
|
||||
- 5432
|
||||
- "5432"
|
||||
web:
|
||||
build: .
|
||||
command: bundle exec rackup -p 3000
|
||||
volumes:
|
||||
- .:/myapp
|
||||
ports:
|
||||
- 3000:3000
|
||||
- "3000:3000"
|
||||
links:
|
||||
- db
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ web:
|
|||
build: .
|
||||
command: php -S 0.0.0.0:8000 -t /code
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
links:
|
||||
- db
|
||||
volumes:
|
||||
|
@ -34,7 +34,7 @@ web:
|
|||
db:
|
||||
image: orchardup/mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
- "3306:3306"
|
||||
environment:
|
||||
MYSQL_DATABASE: wordpress
|
||||
```
|
||||
|
|
|
@ -28,9 +28,11 @@ links:
|
|||
- redis
|
||||
|
||||
-- Expose ports. Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen).
|
||||
-- Note When mapping ports in the format HOST:CONTAINER you may experience erroneous results when using a container port lower than 60. This is due to YAML parsing numbers in the format "xx:yy" as sexagesimal (base 60) for this reason it is recommended to define your port mappings as strings.
|
||||
ports:
|
||||
- 3000
|
||||
- 8000:8000
|
||||
- "3000"
|
||||
- "8000:8000"
|
||||
- "49100:22"
|
||||
|
||||
-- Map volumes from the host machine (HOST:CONTAINER).
|
||||
volumes:
|
||||
|
|
Loading…
Reference in New Issue