Skip to content

Commit 27f2c84

Browse files
authored
Update README.md
1 parent fb75462 commit 27f2c84

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

README.md

+2-30
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,17 @@ entrypoint calls `initdb` to create the default `postgres` user and database,
1010
it will run any `*.sql` files and source any `*.sh` scripts found in that
1111
directory to do further initialization before starting the service.*
1212

13-
This directory contains a script to create multiple databases using that
14-
mechanism.
15-
16-
## Usage
17-
18-
### By mounting a volume
19-
20-
Clone the repository, mount its directory as a volume into
21-
`/docker-entrypoint-initdb.d` and declare database names separated by commas in
22-
`POSTGRES_MULTIPLE_DATABASES` environment variable as follows
23-
(`docker-compose` syntax):
13+
## Usage (docker-compose)
2414

2515
myapp-postgresql:
26-
image: postgres:9.6.2
16+
image: ghcr.io/captmicr0/docker-postgresql-multiple-databases:latest
2717
volumes:
2818
- ../docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
2919
environment:
3020
- POSTGRES_MULTIPLE_DATABASES=db1,db2
3121
- POSTGRES_USER=myapp
3222
- POSTGRES_PASSWORD=mypassword
3323

34-
### By building a custom image
35-
36-
Clone the repository, build and push the image to your Docker repository,
37-
for example for Google Private Repository do the following:
38-
39-
docker build --tag=eu.gcr.io/your-project/postgres-multi-db .
40-
gcloud docker -- push eu.gcr.io/your-project/postgres-multi-db
41-
42-
You still need to pass the `POSTGRES_MULTIPLE_DATABASES` environment variable
43-
to the container:
44-
45-
myapp-postgresql:
46-
image: eu.gcr.io/your-project/postgres-multi-db
47-
environment:
48-
- POSTGRES_MULTIPLE_DATABASES=db1,db2
49-
- POSTGRES_USER=myapp
50-
- POSTGRES_PASSWORD=mypassword
51-
5224
### Non-standard database names
5325

5426
If you need to use non-standard database names (hyphens, uppercase letters etc), no quotes are needed with this fork:

0 commit comments

Comments
 (0)