Giter Site home page Giter Site logo

docker-pgadmin4's Introduction

pgAdmin4 in docker container - Version 4.11

NAME Data Type REQUIRED
SERVER_PORT Integer NO
SERVER_MODE Boolean YES
PGADMIN_SETUP_EMAIL String NO*
PGADMIN_SETUP_PASSWORD String NO*
MAIL_SERVER String NO*
MAIL_PORT Integer NO*
MAIL_USE_SSL Boolean NO*
MAIL_USE_TLS Boolean NO*
MAIL_USERNAME String NO*
MAIL_PASSWORD String NO*
UID Integer NO
GID Integer NO

* -> if SERVER_MODE set false

Example commands

Quick start

$ docker run -d -p 5050:5050 chorss/docker-pgadmin4

$ docker run -d -p 5050:5050 -v $HOME/mydata:/data chorss/docker-pgadmin4

Data storage outside of the container

This will store session, configuration and storage on the given volume. The application user within the container will change it's uid/gid to the given values and will use this uid/gid to write to the volume-directory.

docker run -d -p 5050:5050 -e UID=2301 -e GID=2301 -v $HOME/mydata:/data chorss/docker-pgadmin4

On most shells, you can run with the UID/GID of the current user like this

docker run -d -p 5050:5050 -e UID=`id -u` -e GID=`id -g` -v $HOME/mydata:/data chorss/docker-pgadmin4

Remember to create $HOME/mydata before running the command above.

docker-pgadmin4's People

Contributors

chorss avatar leorochael avatar populov avatar sumpfgottheit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-pgadmin4's Issues

Integrate changes from https://github.com/sumpfgottheit/docker-pgAdmin4

Hi,

I don't want to make a pull request, because my changes change your concept, as I no longer use the USER directive, but start pgadmin via su-exec.

The README contains a list with changes to your version:

I can of course make a pull request, if you want.

Permission denied: '/data/config'

Using the command docker run -d -p 5050:5050 -v /home/user/data:/data chorss/docker-pgadmin4 I'm getting this error:

Traceback (most recent call last):
  File "./usr/local/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py", line 55, in <module>
    exec(open(file_quote(setupfile), 'r').read())
  File "<string>", line 46, in <module>
  File "/usr/local/lib/python2.7/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 23, in create_app_data_directory
    _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
  File "/usr/local/lib/python2.7/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 15, in _create_directory_if_not_exists
    os.mkdir(_path)
OSError: [Errno 13] Permission denied: '/data/config'

no Port Exposed

Hi ,
I am not sure if i am missing something
i cant see an EXPOSE line.
So there is no exposed port ? I see previous builds have EXPOSE
usually port 5050

Thanks

Container doesnt start because of unmet python dependencies

GID=50
UID=1000
usermod: no changes
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py", line 67, in <module>
    app = create_app()
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgadmin/__init__.py", line 569, in create_app
    from flask_htmlmin import HTMLMIN
ModuleNotFoundError: No module named 'flask_htmlmin'

Fix required:

pip install flask_htmlmin

Confirmed using:

docker run -it --name saveit chorss/docker-pgadmin4 pip install flask_htmlmin
docker commit saveit chorss/docker-pgadmin4
docker run --rm -it chorss/docker-pgadmin4

backup and restore

this image is awesome. but i got some difficulties when i want to executes backup and restore process.
fyi.
i successfully restore data manually in container db-engine
i use this image "centos/postgresql-94-centos7" as database-engine.
any advise how to setup the backup and restore process.
thanks

PermissionError when tryting to start container

Hi,

OS : openSUSE Leap 64 bits
Docker Version : 17.04.0-ce
CPU | 56
Memory | 135.1 GB

When trying to start Docker with command like quickstart,
docker run -d -p 8000:5050 -v /srv/data/pgadmin4_data:/data chorss/docker-pgadmin4

starting failed, see log :

usermod: no changes
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py", line 55, in <module>
    exec(open(file_quote(setupfile), 'r').read())
  File "<string>", line 46, in <module>
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 26, in create_app_data_directory
    _create_directory_if_not_exists(os.path.dirname(config.LOG_FILE))
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 15, in _create_directory_if_not_exists
    os.mkdir(_path)
PermissionError: [Errno 13] Permission denied: '/data/logs'

even with specify when I specify default OS user and associated group :

docker run -d -p 8000:5050 -e UID=1000 -e GID=100 -v /srv/data/pgadmin4_data:/data chorss/docker-pgadmin4

groupmod: GID '100' already exists
usermod: no changes
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgAdmin4.py", line 55, in <module>
    exec(open(file_quote(setupfile), 'r').read())
  File "<string>", line 46, in <module>
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 26, in create_app_data_directory
    _create_directory_if_not_exists(os.path.dirname(config.LOG_FILE))
  File "/usr/local/lib/python3.6/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 15, in _create_directory_if_not_exists
    os.mkdir(_path)
PermissionError: [Errno 13] Permission denied: '/data/logs'

I'm quite new about Docker but it seems I've done right but on the same machine, i!'m running other docker such as portainer, postgis, etc.

Thanks for help ;)

SSL

When I use your sample to run the container, it only works on a http connection not on a https connection... any suggestions ?

login failed

image: chorss/docker-pgadmin4
    ports:
      - 8888:5050
    environment:
      - SERVER_MODE=true
      - [email protected]
      - PGADMIN_SETUP_PASSWORD=xxxxxx
    volumes:
      - ./pgadmin_data:/data 

this is my docker-compose.yml file, i start stack ,in browser i can open web page,but i input [email protected] / xxxxxx, login failed... what' wrong , your doc less of something ,,you know

Here is a Dockerfile which will build v3.5

Can't open a pull request, but this runs locally on my machine

FROM python:alpine3.8

LABEL maintainer="Kacper Czarczyński <[email protected]>"

ENV PGADMIN_VERSION 3.5
ENV UID             1000
ENV GID             50

ENV SERVER_MODE   false
ENV SERVER_PORT   5050
ENV MAIL_SERVER   mail.example.tld
ENV MAIL_PORT     465
ENV MAIL_USE_SSL  false
ENV MAIL_USE_TLS  false
ENV MAIL_USERNAME username
ENV MAIL_PASSWORD password
ENV MAIL_DEBUG    false

# Metadata
LABEL   org.label-schema.name="pgAdmin4" \
        org.label-schema.description="Docker image pgAdmin4" \
        org.label-schema.url="https://www.pgadmin.org" \
        org.label-schema.license="PostgreSQL" \
        org.label-schema.version=${PGADMIN_VERSION} \
        org.label-schema.vcs-url="https://github.com/Chorss/docker-pgAdmin4"

RUN apk add --no-cache --virtual .run-deps postgresql postgresql-libs libffi-dev openssl shadow sudo su-exec bash linux-headers
RUN apk add --no-cache --virtual .build-deps make gcc musl-dev openssl postgresql-dev \
 && pip3 --no-cache-dir install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${PGADMIN_VERSION}/pip/pgadmin4-${PGADMIN_VERSION}-py2.py3-none-any.whl \
 && apk del .build-deps \
 && rm -rf /root/.cache

RUN addgroup -g ${GID} -S pgadmin \
 && adduser -D -S -h /pgadmin -s /sbin/nologin -u ${UID} -G pgadmin pgadmin \
 && mkdir -p /data/config /data/logs /data/storage /data/sessions /data/misc \
 && chown -R ${UID}:${GID} /data \
 && rm -rf /root/.cache

COPY config_local.py /usr/local/lib/python3.7/site-packages/pgadmin4/
COPY entrypoint /
RUN chmod 0775 /entrypoint

VOLUME /data
EXPOSE ${SERVER_PORT}
ENTRYPOINT ["/entrypoint"]

CMD ["su-exec", "pgadmin", "python", "/usr/local/lib/python3.7/site-packages/pgadmin4/pgAdmin4.py"]

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.