@@ -10,45 +10,17 @@ entrypoint calls `initdb` to create the default `postgres` user and database,
10
10
it will run any ` *.sql ` files and source any ` *.sh ` scripts found in that
11
11
directory to do further initialization before starting the service.*
12
12
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)
24
14
25
15
myapp-postgresql:
26
- image: postgres:9.6.2
16
+ image: ghcr.io/captmicr0/docker-postgresql-multiple-databases:latest
27
17
volumes:
28
18
- ../docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
29
19
environment:
30
20
- POSTGRES_MULTIPLE_DATABASES=db1,db2
31
21
- POSTGRES_USER=myapp
32
22
- POSTGRES_PASSWORD=mypassword
33
23
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
-
52
24
### Non-standard database names
53
25
54
26
If you need to use non-standard database names (hyphens, uppercase letters etc), no quotes are needed with this fork:
0 commit comments