Giter Site home page Giter Site logo

pgadmin4-docker's Introduction

pgAdmin 4

This is a simple Docker image for running pgAdmin 4 in a container. It is not intended for production use (it runs in "desktop mode", so authentication is disabled).

IMPORTANT: As of version 1.0, this image uses an unprivileged user, and uses port 5050 instead of 80. To access the web-interface on port 80, use port-mapping; -p 80:5050.

Example use

Quick start

To see this image in action, run the following command;

$ docker run --rm -p 5050:5050 thajeztah/pgadmin4

This starts a one-off container in non-detached mode, and container logs are printed in your terminal. After the container has finished starting, visit http://[your-docker-host]:5050 in your browser to try pgAdmin 4.

To exit and remove the container, press CTRL+C in your terminal.

Practical example

This example uses a custom network, and runs a PostgreSQL container.

# create a custom network for easier connecting
$ docker network create pg

# start a postgres container
$ docker run -d -e POSTGRES_PASSWORD=password --net pg --name postgres postgres

# start pgAdmin container
$ docker run -d -p 5050:5050 --name pgadmin --net pg thajeztah/pgadmin4

Now visit http://[your-docker-host]:5050 in your browser. You can add the postgres database (hostname is postgres, password is password) to test if everything is working.

screenshot

Persistent data

Persistent data is stored in a volume, located at /pgadmin/. This allows you to upgrade the container to a new version without losing configuration.

The following directories can be found inside the volume;

  • /pgadmin/config/pgadmin4.db - SQLite configuration database
  • /pgadmin/storage/ - other storage

You can override the storage location by setting the PG_ADMIN_DATA_DIR environment variable

Unprivileged user

pgAdmin runs as an unprivileged user (pgadmin) with uid:gid 1000:50. The uid:gid is selected for compatibility with Docker Toolbox, and allows you to bind-mount a local directory inside the container for persistent storage

For example, to bind-mount the /Users/me/pgadmin directory as storage directory;

$ docker run -d -p 5050:5050 -v /Users/me/pgadmin:/pgadmin thajeztah/pgadmin4

Run the image with a read-only filesystem

This image can be run with a read-only filesystem. To do so, specify the --read-only flag when starting the container.

$ docker run -d -p 5050:5050 --name pgadmin --read-only thajeztah/pgadmin4

Runtime configuration

This image can be configured at runtime, by setting environment variables;

  • PG_ADMIN_DATA_DIR directory to use for storing data (defaults to /pgadmin/)
  • PG_ADMIN_PORT port to listen on (defaults to 5050)
  • DEBUG enable debug mode (detaults to False)

More information on pgAdmin 4 development can be found here;

pgadmin4-docker's People

Contributors

thajeztah avatar graphaelli avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.