https://github.com/a0s/postgres-remote-initdb
Run Postgres container with initial data fetched from remote url
https://github.com/a0s/postgres-remote-initdb
docker postgres
Last synced: 3 months ago
JSON representation
Run Postgres container with initial data fetched from remote url
- Host: GitHub
- URL: https://github.com/a0s/postgres-remote-initdb
- Owner: a0s
- Created: 2017-12-15T18:55:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T12:47:44.000Z (about 7 years ago)
- Last Synced: 2025-11-17T00:03:22.208Z (8 months ago)
- Topics: docker, postgres
- Language: Shell
- Homepage: https://github.com/a0s/postgres-remote-initdb
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postgres-remote-initdb
Run Postgres container with initial data fetched from remote url.
This is fork of the official [postgres:alpine](https://hub.docker.com/_/postgres).
## Usage
```bash
docker build -t postgres-remote-initdb .
docker run --rm -it -p 5432:5432 \
-e SRC_URL="http://sql.service.consul/dump" \
-e ON_ERROR_STOP=0 \
-e POSTGRES_PASSWORD=aaa \
-e POSTGRES_DB=aaa \
-e POSTGRES_USER=aaa \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v postgres_data:/var/lib/postgresql/data/pgdata \
postgres-remote-initdb
```
Variables:
- `SRC_URL` - URI of server that returns sql dump
- `ON_ERROR_STOP` - psql's ON_ERROR_STOP variable, default is 0
- `POSTGRES_PASSWORD` - same as in official image
- `POSTGRES_DB` - same as in official image
- `POSTGRES_USER` - same as in official image
- `PGDATA` - same as in official image