Last active
August 18, 2018 15:00
-
-
Save jkatz/c71b250447407e85a9c766a216c44096 to your computer and use it in GitHub Desktop.
Example with PostgreSQL + PostGIS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir postgres | |
cd postgres | |
docker volume create --driver local --name=pgvolume | |
docker volume create --driver local --name=pga4volume | |
docker network create --driver bridge pgnetwork | |
cat << EOF > pg-env.list | |
PG_MODE=primary | |
PG_PRIMARY_USER=postgres | |
PG_PRIMARY_PASSWORD=yoursecurepassword | |
PG_DATABASE=testdb | |
PG_USER=yourusername | |
PG_PASSWORD=yoursecurepassword | |
PG_ROOT_PASSWORD=yoursecurepassword | |
PG_PRIMARY_PORT=5432 | |
EOF | |
cat << EOF > pgadmin-env.list | |
[email protected] | |
PGADMIN_SETUP_PASSWORD=yoursecurepassword | |
SERVER_PORT=5050 | |
EOF | |
docker run --publish 5432:5432 \ | |
--volume=pgvolume:/pgdata \ | |
--env-file=pg-env.list \ | |
--name="postgres" \ | |
--hostname="postgres" \ | |
--network="pgnetwork" \ | |
--detach \ | |
crunchydata/crunchy-postgres-gis:centos7-10.5-2.1.0 | |
docker run --publish 5050:5050 \ | |
--volume=pga4volume:/var/lib/pgadmin \ | |
--env-file=pgadmin-env.list \ | |
--name="pgadmin4" \ | |
--hostname="pgadmin4" \ | |
--network="pgnetwork" \ | |
--detach \ | |
crunchydata/crunchy-pgadmin4:centos7-10.5-2.1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment