All Projects → mrts → Docker Postgresql Multiple Databases

mrts / Docker Postgresql Multiple Databases

Licence: mit
Using multiple databases with the official PostgreSQL Docker image

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Docker Postgresql Multiple Databases

Blog Tutorials
⭐️ Codebase for the tutorials on my blog about Java, Spring Boot, AWS, Kotlin and Testing
Stars: ✭ 257 (-11.38%)
Mutual labels:  postgresql
Takeoff
A rapid development environment using docker for convenience.
Stars: ✭ 271 (-6.55%)
Mutual labels:  postgresql
Orafce
The "orafce" project implements in Postgres some of the functions from the Oracle database that are missing (or behaving differently).Those functions were verified on Oracle 10g, and the module is useful for production work.
Stars: ✭ 274 (-5.52%)
Mutual labels:  postgresql
Postgui
A React web application to query and share any PostgreSQL database.
Stars: ✭ 260 (-10.34%)
Mutual labels:  postgresql
Pg Promise
PostgreSQL interface for Node.js
Stars: ✭ 3,059 (+954.83%)
Mutual labels:  postgresql
Pg chameleon
MySQL to PostgreSQL replica system
Stars: ✭ 274 (-5.52%)
Mutual labels:  postgresql
Homebrew Postgresql
🐘 PostgreSQL formulae for the Homebrew package manager
Stars: ✭ 258 (-11.03%)
Mutual labels:  postgresql
Plgo
easily create postgresql extensions in golang; moved to gitlab.com/microo8/plgo
Stars: ✭ 286 (-1.38%)
Mutual labels:  postgresql
Stoq
Stoq Retail Management System
Stars: ✭ 269 (-7.24%)
Mutual labels:  postgresql
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (+1074.14%)
Mutual labels:  postgresql
Waline
A Simple, Safe Comment System inspired by Valine | 一款基于 Valine 衍生的简洁、安全的评论系统
Stars: ✭ 260 (-10.34%)
Mutual labels:  postgresql
Entityframework.exceptions
Handle database errors easily when working with Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql
Stars: ✭ 266 (-8.28%)
Mutual labels:  postgresql
Dbq
Zero boilerplate database operations for Go
Stars: ✭ 273 (-5.86%)
Mutual labels:  postgresql
Pgmemento
Audit trail with schema versioning for PostgreSQL using transaction-based logging
Stars: ✭ 260 (-10.34%)
Mutual labels:  postgresql
Sqlc
Generate type-safe code from SQL
Stars: ✭ 4,564 (+1473.79%)
Mutual labels:  postgresql
Incubator Age
Graph database optimized for fast analysis and real-time data processing. It is provided as an extension to PostgreSQL.
Stars: ✭ 244 (-15.86%)
Mutual labels:  postgresql
Bitnami Docker Postgresql
Bitnami PostgreSQL Docker Image
Stars: ✭ 272 (-6.21%)
Mutual labels:  postgresql
Paf
PostgreSQL Automatic Failover: High-Availibility for Postgres, based on Pacemaker and Corosync.
Stars: ✭ 288 (-0.69%)
Mutual labels:  postgresql
Psycopg3
New generation PostgreSQL database adapter for the Python programming language
Stars: ✭ 278 (-4.14%)
Mutual labels:  postgresql
Pgquarrel
pgquarrel compares PostgreSQL database schemas (DDL)
Stars: ✭ 274 (-5.52%)
Mutual labels:  postgresql

Using multiple databases with the official PostgreSQL Docker image

The official recommendation for creating multiple databases is as follows:

If you would like to do additional initialization in an image derived from this one, add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d (creating the directory if necessary). After the entrypoint calls initdb to create the default postgres user and database, it will run any *.sql files and source any *.sh scripts found in that directory to do further initialization before starting the service.

This directory contains a script to create multiple databases using that mechanism.

Usage

By mounting a volume

Clone the repository, mount its directory as a volume into /docker-entrypoint-initdb.d and declare database names separated by commas in POSTGRES_MULTIPLE_DATABASES environment variable as follows (docker-compose syntax):

myapp-postgresql:
    image: postgres:9.6.2
    volumes:
        - ../docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
    environment:
        - POSTGRES_MULTIPLE_DATABASES=db1,db2
        - POSTGRES_USER=myapp
        - POSTGRES_PASSWORD=

By building a custom image

Clone the repository, build and push the image to your Docker repository, for example for Google Private Repository do the following:

docker build --tag=eu.gcr.io/your-project/postgres-multi-db .
gcloud docker -- push eu.gcr.io/your-project/postgres-multi-db

You still need to pass the POSTGRES_MULTIPLE_DATABASES environment variable to the container:

myapp-postgresql:
    image: eu.gcr.io/your-project/postgres-multi-db
    environment:
        - POSTGRES_MULTIPLE_DATABASES=db1,db2
        - POSTGRES_USER=myapp
        - POSTGRES_PASSWORD=

Non-standard database names

If you need to use non-standard database names (hyphens, uppercase letters etc), quote them in POSTGRES_MULTIPLE_DATABASES:

    environment:
        - POSTGRES_MULTIPLE_DATABASES="test-db-1","test-db-2"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].