Tag: postgresql

Rails and postgres application to Docker compose v2, data strategy

I just started learning Docker and am now trying to build my Rails application that uses postgres in a docker setup. Currently my docker file looks as follows: FROM ruby:2.2.5 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs # Set an environment variable to store where the app is installed to inside […]

Dockerize stack: MapServer – AngularJs web app – Lumen API – PostgreSQL

I’m trying to solve some of my question regarding the architecture of a system consisting of the following: AngularJS web application frontend MapServer generating & serving map images through WMS Lumen REST API backend containing all the business logic PostgreSQL database with PostGIS to store spatial data Which is the proper way to dockerize that […]

Why am I getting docker@postgres ERROR: relation “accounts_myprofile” does not exist?

So I am working on a project Django/Postgres project. When I run docker-compose up, the project launches with Django in one container and Postgres in the other. I am able to view certain URL’s of my project, however the ones that query MyProfile model, all result in the following error: docker@postgres ERROR: relation “accounts_myprofile” does […]

Unable to connect to dockerized postgres on localhost, but remote connection is working

I created docker postgres instance with docker run -d \ –name test_db \ -v data:/var/lib/postgresql/data \ -e “POSTGRES_PASSWORD=abcdefghij” \ -e “POSTGRES_USER=testuser” \ -p 5432:5432 \ postgres I can properly connect to this database from other hosts using public server ip, eg. psql -U testuser -h -d testuser // in reality I use proper IP […]

How can I fix binary file corrupted by pseudo-terminal option during ssh transfer?

I had create the dump of database which located inside docker container using this command: docker exec -it container_id pg_dump -U postgres -Fc -d database_name > local_file.dump -t flag enable pseudo-terminal mode. As a result local_file.dump is corrupted. Can I fix this binary file?

Copy Postgres database structures but not data

We are creating a Dockerfile that can spin up a Postgres database container, using this image as a basis https://hub.docker.com/_/postgres/ Every time we test we want to create a fresh database with the production database as a template – we want to copy the database structures without copying the data in tables etc. Can someone […]

apache-php doesn't start with docker-compose

I have this container which seems to not work, and I’m unable to figure why, it left no logs FROM debian:latest RUN apt-get update && apt-get -y install apache2 libapache2-mod-php5 RUN apt-get -y install postgresql php5-pgsql RUN apt-get update && apt-get -y install php5-common php5-cli php5-fpm php5-mcrypt php5-pgsql php5-apcu php5-gd php5-imagick php5-curl php5-intl RUN a2enmod […]

Can't start docker with postgres

Can’t start docker with postgres, could not access private key file “/etc/ssl/private/ssl-cert-snakeoil.key The command I ran: sudo docker exec tryton-server /etc/init.d/postgresql start Error: tryton-server Starting PostgreSQL 9.4 database server: mainThe PostgreSQL server failed to start. Please check the log output: 2016-11-11 03:42:24 UTC [27-1] FATAL: could not access private key file “/etc/ssl/private/ssl-cert-snakeoil.key”: Permission denied … […]

How to allow my host IP address in the PostgreSQL pg_hba.conf file

I’m having a PostgreSQL instance running on my local machine, listening on all the interfaces (listen_addresses = ‘*’), and Docker running a Rails application which needs to connect to this database. Updating manually the pg_hba.conf file by adding a line allowing my IP address makes the application working. Now, given my computer has the IP […]

Connecting to Host Postgresql From inside a Container

I have a python application running inside a container. The application needs to connect to PostgreSQL that is running in host (not in any other container ). I tried various approaches spread around the internet still no luck since a day. Possible reason for failure may be lack of correct implementation or Knowledge base. Any […]

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