Skip to content

Commit 59e31ff

Browse files
committed
Update docs to remove numeric suffix
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
1 parent 62a4d21 commit 59e31ff

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

docs/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ One-off commands are started in new containers with the same config as a normal
5151

5252
Links are also created between one-off commands and the other containers for that service so you can do stuff like this:
5353

54-
$ fig run db psql -h db_1 -U postgres
54+
$ fig run db psql -h db -U docker
5555

5656
If you do not want linked containers to be started when running the one-off command, specify the `--no-deps` flag:
5757

docs/django.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ First thing we need to do is set up the database connection. Replace the `DATABA
5959
'ENGINE': 'django.db.backends.postgresql_psycopg2',
6060
'NAME': 'postgres',
6161
'USER': 'postgres',
62-
'HOST': 'db_1',
62+
'HOST': 'db',
6363
'PORT': 5432,
6464
}
6565
}

docs/env.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ title: Fig environment variables reference
66
Environment variables reference
77
===============================
88

9-
**Note:** Environment variables are no longer the recommended method for connecting to linked services. Instead, you should use the link name (by default, <b><i>name</i>_1</b>) as the hostname to connect to. See the [fig.yml documentation](yml.html#links) for details.
9+
**Note:** Environment variables are no longer the recommended method for connecting to linked services. Instead, you should use the link name (by default, the name of the linked service) as the hostname to connect to. See the [fig.yml documentation](yml.html#links) for details.
1010

1111
Fig uses [Docker links] to expose services' containers to one another. Each linked container injects a set of environment variables, each of which begins with the uppercase name of the container.
1212

1313
To see what environment variables are available to a service, run `fig run SERVICE env`.
1414

1515
<b><i>name</i>\_PORT</b><br>
16-
Full URL, e.g. `DB_1_PORT=tcp://172.17.0.5:5432`
16+
Full URL, e.g. `DB_PORT=tcp://172.17.0.5:5432`
1717

1818
<b><i>name</i>\_PORT\_<i>num</i>\_<i>protocol</i></b><br>
19-
Full URL, e.g. `DB_1_PORT_5432_TCP=tcp://172.17.0.5:5432`
19+
Full URL, e.g. `DB_PORT_5432_TCP=tcp://172.17.0.5:5432`
2020

2121
<b><i>name</i>\_PORT\_<i>num</i>\_<i>protocol</i>\_ADDR</b><br>
22-
Container's IP address, e.g. `DB_1_PORT_5432_TCP_ADDR=172.17.0.5`
22+
Container's IP address, e.g. `DB_PORT_5432_TCP_ADDR=172.17.0.5`
2323

2424
<b><i>name</i>\_PORT\_<i>num</i>\_<i>protocol</i>\_PORT</b><br>
25-
Exposed port number, e.g. `DB_1_PORT_5432_TCP_PORT=5432`
25+
Exposed port number, e.g. `DB_PORT_5432_TCP_PORT=5432`
2626

2727
<b><i>name</i>\_PORT\_<i>num</i>\_<i>protocol</i>\_PROTO</b><br>
28-
Protocol (tcp or udp), e.g. `DB_1_PORT_5432_TCP_PROTO=tcp`
28+
Protocol (tcp or udp), e.g. `DB_PORT_5432_TCP_PROTO=tcp`
2929

3030
<b><i>name</i>\_NAME</b><br>
3131
Fully qualified container name, e.g. `DB_1_NAME=/myapp_web_1/myapp_db_1`

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ from flask import Flask
5959
from redis import Redis
6060
import os
6161
app = Flask(__name__)
62-
redis = Redis(host="redis_1", port=6379)
62+
redis = Redis(host='redis', port=6379)
6363
6464
@app.route('/')
6565
def hello():

docs/rails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Open up your newly-generated `database.yml`. Replace its contents with the follo
7373
pool: 5
7474
username: postgres
7575
password:
76-
host: db_1
76+
host: db
7777

7878
test:
7979
<<: *default

docs/wordpress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Two supporting files are needed to get this working - first up, `wp-config.php`
4444
define('DB_NAME', 'wordpress');
4545
define('DB_USER', 'root');
4646
define('DB_PASSWORD', '');
47-
define('DB_HOST', "db_1:3306");
47+
define('DB_HOST', "db:3306");
4848
define('DB_CHARSET', 'utf8');
4949
define('DB_COLLATE', '');
5050

docs/yml.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ command: bundle exec thin -p 3000
3939
<a name="links"></a>
4040
### links
4141

42-
Link to containers in another service. Optionally specify an alternate name for the link, which will determine how environment variables are prefixed, e.g. `db` -> `DB_1_PORT`, `db:database` -> `DATABASE_PORT`
42+
Link to containers in another service. Either specify both the service name and the link alias (`SERVICE:ALIAS`), or just the service name (which will also be used for the alias).
4343

4444
```
4545
links:
@@ -51,9 +51,9 @@ links:
5151
An entry with the alias' name will be created in `/etc/hosts` inside containers for this service, e.g:
5252

5353
```
54-
172.17.2.186 db_1
54+
172.17.2.186 db
5555
172.17.2.186 database
56-
172.17.2.187 redis_1
56+
172.17.2.187 redis
5757
```
5858

5959
Environment variables will also be created - see the [environment variable reference](env.html) for details.

0 commit comments

Comments
 (0)