File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM postgres:9.6
2+ COPY create-multiple-postgresql-databases.sh /docker-entrypoint-initdb.d/
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ mechanism.
1515
1616## Usage
1717
18+ ### By mounting a volume
19+
1820Clone the repository, mount its directory as a volume into
1921` /docker-entrypoint-initdb.d ` and declare database names separated by commas in
2022` POSTGRES_MULTIPLE_DATABASES ` environment variable as follows
@@ -28,3 +30,21 @@ Clone the repository, mount its directory as a volume into
2830 - POSTGRES_MULTIPLE_DATABASES=db1,db2
2931 - POSTGRES_USER=myapp
3032 - POSTGRES_PASSWORD=
33+
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=
You can’t perform that action at this time.
0 commit comments