Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fbfe506

Browse files
committedOct 13, 2020
add postgresql docker service
1 parent 3f13b90 commit fbfe506

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
 

‎.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

‎database.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POSTGRES_USER=unicorn_user
2+
POSTGRES_PASSWORD=magical_password
3+
POSTGRES_DB=rainbow_database

‎docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ services:
66
dockerfile: Dockerfile
77
ports:
88
- "1993:1993"
9+
database:
10+
image: "postgres" # use latest official postgres version
11+
env_file:
12+
- database.env # configure postgres
13+
volumes:
14+
- database-data:/var/lib/postgresql/data/ # persist data even if container shuts down
15+
volumes:
16+
database-data: # named volumes can be managed easier using docker-compose

0 commit comments

Comments
 (0)
Please sign in to comment.