Tag: postgresql

How to drop `django_admin_log` with docker-compose?

I am using a docker-compose.yml file for my django app, and I am trying to do docker-compose run web python manage.py dbshell and drop the table django_admin_log like here. But this returned CommandError: You appear not to have the ‘psql’ program installed or on your path. How can I do python manage.py dbshell or drop […]

Connect Symfony project to docker database

I’m currently working on a project, that works with bag-files. Therefore I’m using a tool called bag-database(https://github.com/swri-robotics/bag-database), where the database is running as two docker containers. I followed the instructions on the site really closely and got it up and running on port 8080. The other container is running on port 5432. So now I’m […]

How to connect to a dockerized PostgreSQL from (an undockerized) Python app

I have followed the instructions here to install PostgreSQL through Docker. In fact, I have used the following two commands: Run docker run –name postgresql -d sameersbn/postgresql:9.4-2 Login sudo docker exec -it postgresql sudo -u postgres psql Then I do \conninfo and I get: # You are connected to database “postgres” as user “postgres” via […]

Why doesn't postgres official docker repo start db service at build time?

Under the background of https://github.com/docker-library/postgres (github repo) and https://registry.hub.docker.com/_/postgres/ (docker hub) It can be seen database is started by Entrypoint and CMD with bash script /docker-entrypoint.sh with ENTRYPOINT [“/docker-entrypoint.sh”] EXPOSE 5432 CMD [“postgres”] another script hook provided to change database is /docker-entrypoint-initdb.d which means the database starts (can be pqsl) only at runtime, when docker […]

Postgres docker container vs. hosted solution

I’m used to building web apps the ‘traditional’ way but am trying to wrap my head around using docker. If I run postgres in a container along with my python web app, is this the same as spinning up a digital ocean server and installing postgres from scratch? How do I handle backups, fault tolerance, […]

How to move Postresql to RAM disk in Docker?

I want to run the Docker image postgres:9, stop Postgres, move it to /dev/shm, and restart it, so I can run my application tests really fast. But when I try to stop Postgres in the container using postgres or pg_ctl I get told cannot be run as root. Since all Docker containers log you in […]

docker-compose psql could not connect to server

i looked at the github MD file for bottled-water to use it using docker and i’ve run into a problem regarding postgresql if i run docker-compose run –rm postgres psql i get the error /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL […]

Run postgresql docker image with persistent data returns permission error

I’ve been running my docker images upon my Vagrant machine (the box is ubuntu 14.04) without any big issues. But the following error is racking my brains. I wish you people can help me. When I run this: $ docker run -it -v /vagrant/postgresql/data:/var/lib/postgresql/data postgres:9.2 I get this error The files belonging to this database […]

Using a PostgreSQL database with Docker and Flask, how does it work?

I just started using Docker and created an image and running container with Python3, Flask, UWSGI and nginx. Now I want to use a postgresql database in Flask. I read the following page and linking containers seems logical to me. (https://hub.docker.com/_/postgres/) I still have some question or maybe the principle of Docker isn’t just clear […]

Docker – Rails app cannot connect to linked Postgres container (doesn't seem to be running)

I’ve been following this guide of how to set up a Rails Development Environment using Docker: Setting Up A Rails Development Environment Using Docker. I’ve hit a few snags along the way, but I’ve managed to get through most of them up until the step of running Rails migration. Running the command docker-compose run web […]

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