-
Notifications
You must be signed in to change notification settings - Fork 3
Docker Database
vanpeerdevelopment edited this page Jan 14, 2016
·
2 revisions
# Dockerfile
FROM postgres:9.5.0
ENV POSTGRES_USER=postgres
ENV POSTGRES_PASSWORD=secret
ENV POSTGRES_DB=dws
COPY Vx.x_init.sh /docker-entrypoint-initdb.d/# Vx.x_init.sh
psql -U $POSTGRES_USER -w
-c "CREATE USER dws WITH ENCRYPTED PASSWORD 'dws'" dws
psql -U $POSTGRES_USER -w
-c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO dws" dws The DWS database image is based on the official PostgreSQL 9.5.0 docker image.
The following environment variables can be used to configure the image.
-
POSTGRES_USER
Name of the superuser to create,postgresif not defined. -
POSTGRES_PASSWORD
Password for the created superuser,mysecretpasswordif not defined. -
POSTGRES_DB
Name of the database to create,POSTGRES_USERvalue if not defined. -
PGDATA
Location of the databse files,/var/lib/postgresql/dataif not defined. initdb
When the superuser and database are created, sql files and scripts in /docker-entrypoint-initdb.d folder will be executed to further configure the database before starting the service. The files will be executed in alphabetical order. The sql files will be executed by POSTGRES_USER. It is best to run all psql as POSTGRES_USER because it can connect without a password in the container.
- Context Diagram
- Container Diagram
- Component Diagram
- Docker
- Maven and Gulp
- Jenkins