Documentation: Include notes on mapping ports

When mapping ports as strings there is an issue with the way YAML parses
numbers in the format "xx:yy" where yy is less than 60 - this issue is
now included in the documentation.

This fixes #103
This commit is contained in:
Gary Rennie 2014-02-20 12:53:43 +00:00
parent bf47aa97b4
commit b06d37f885
7 changed files with 17 additions and 12 deletions

View File

@ -22,11 +22,14 @@ web:
links: links:
- db - db
ports: ports:
- 8000:8000 - "8000:8000"
- "49100:22"
db: db:
image: orchardup/postgresql 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!) (No more installing Postgres on your laptop!)
Then type `fig up`, and Fig will start and run your entire app: Then type `fig up`, and Fig will start and run your entire app:

View File

@ -29,14 +29,14 @@ Simple enough. Finally, this is all tied together with a file called `fig.yml`.
db: db:
image: orchardup/postgresql image: orchardup/postgresql
ports: ports:
- 5432 - "5432"
web: web:
build: . build: .
command: python manage.py runserver 0.0.0.0:8000 command: python manage.py runserver 0.0.0.0:8000
volumes: volumes:
- .:/code - .:/code
ports: ports:
- 8000:8000 - "8000:8000"
links: links:
- db - db

View File

@ -1,7 +1,7 @@
jekyll: jekyll:
build: . build: .
ports: ports:
- 4000:4000 - "4000:4000"
volumes: volumes:
- .:/code - .:/code
environment: environment:

View File

@ -21,7 +21,7 @@ web:
links: links:
- db - db
ports: ports:
- 8000:8000 - "8000:8000"
db: db:
image: orchardup/postgresql image: orchardup/postgresql
``` ```
@ -107,7 +107,7 @@ We then define a set of services using `fig.yml`:
build: . build: .
command: python app.py command: python app.py
ports: ports:
- 5000:5000 - "5000:5000"
volumes: volumes:
- .:/code - .:/code
links: links:

View File

@ -30,14 +30,14 @@ Finally, `fig.yml` is where the magic happens. It describes what services our ap
db: db:
image: orchardup/postgresql image: orchardup/postgresql
ports: ports:
- 5432 - "5432"
web: web:
build: . build: .
command: bundle exec rackup -p 3000 command: bundle exec rackup -p 3000
volumes: volumes:
- .:/myapp - .:/myapp
ports: ports:
- 3000:3000 - "3000:3000"
links: links:
- db - db

View File

@ -26,7 +26,7 @@ web:
build: . build: .
command: php -S 0.0.0.0:8000 -t /code command: php -S 0.0.0.0:8000 -t /code
ports: ports:
- 8000:8000 - "8000:8000"
links: links:
- db - db
volumes: volumes:
@ -34,7 +34,7 @@ web:
db: db:
image: orchardup/mysql image: orchardup/mysql
ports: ports:
- 3306:3306 - "3306:3306"
environment: environment:
MYSQL_DATABASE: wordpress MYSQL_DATABASE: wordpress
``` ```

View File

@ -28,9 +28,11 @@ links:
- redis - redis
-- Expose ports. Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen). -- 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: ports:
- 3000 - "3000"
- 8000:8000 - "8000:8000"
- "49100:22"
-- Map volumes from the host machine (HOST:CONTAINER). -- Map volumes from the host machine (HOST:CONTAINER).
volumes: volumes: