Tag: postgresql

Dockerized database passwords management

For example, I need to “dockerize” PostgreSQL, MongoDB and Redis each one to a separate container. I want to create a secure passwords-protected users/roles for that storages and then access them from a several dockerized applications. Dockerfiles are surely under the VCS and I won’t keep any passwords there. Is there any best practices for […]

I can't access mounted volume of docker-postgres from host

I create my container like this: docker run –name postgresql -itd –restart always \ –publish 5432:5432 \ –volume /my/local/host:/var/lib/postgresql \ sameersbn/postgresql:9.4-11 but, when I do ls on the root directory, I see something like this: drwxrwxr-x 3 messagebus messagebus 4,0K Ιαν 10 00:44 host/ or, in other words, I cannot access the /my/local/host directory. I […]

Is it possible to use Gitlab and WordPress container linked to only one Mariadb container?

I have an instance of Gitlab running on my host, it’s composed by: a Gitlab container, a PostgreSQL container and a Redis container. Gitlab is linked to Postgresql and Redis . Also, there’s an instance of WordPress running, it’s a WordPress and a Mariadb container. WordPress is linked to Mariadb. As both Gitlab and WordPress […]

Play framework multiple ajax request

I have an rest api with Play 2.3.x on a Docker container. This api speak with PostgresSQL 9.4 database (on a Docker container too) and serves JSON. Client is a isomorphic app with React (on Docker container too). When client change route, several request is send to the api. The problem is that every request […]

Docker+Rails+Postgres: app can't access database container

New to Docker; trying to follow along with two COdeShip tutorials for Rails+Postgres inside Docker containers. Database container starts and stops with app container under control of docker-compose up -d and docker-compose rm. Postgres commands are not available inside app container, however, so docker-compose run app bin/rake db:create chokes reporting that createdb could not be […]

Python script to add data to postgres docker container runs multiple times

I’m trying to find a good way to populate a database with initial data for a simple application. I’m using a tutorial from realpython.com as a starting point. I then run a simple python script after the database is created to add a single entry, but when I do this the data is added multiple […]

docker can't not start postgresql server with a existing data directory

I have an existing postgres database just called DB1 and want to docker it, but I can’t start the server just set the PGDATA to the DB1’s data directory, and the message was directory “/var/lib/postgresql/data” is not a database cluster directory but the server can start correctly in the host, why?

Fail to create postgres extensions through bash script

launched a postgres db within docker container and want to install extensions afterwards with following script: su postgres sh -c “psql -U postgres <<EOSQL CREATE EXTENSION hstore; CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION fuzzystrmatch; EOSQL” trap “echo \”Sending SIGTERM to postgres\”; killall -s SIGTERM postgres” SIGTERM su postgres sh -c “$POSTGRES -D $DATADIR […]

Offline restores of a PostgreSQL database

I want to provide initial data in a Docker container inheriting from the official PostgreSQL image. Is there a way I can restore a PostgreSQL dump from the command-line (using pg_restore) while the database server is not running? I found that the following works, but doesn’t use pg_restore : gosu postgres postgres –single -jE <<-EOSQL […]

Proper way to monitor PostgreSQL running inside a docker container

I’m running a docker container with CentOS 7 + PostgreSQL 9.4. Using this docker image. So, after pulling the image, I’ve created the container, following the instructions, and exposing the PostgreSQL port 5432. Of course, I can execute a shell in my container, by doing this docker exec -it CONTAINER_NAME /bin/bash After that, I’m logged […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.