Tag: postgresql

NodeJS: Can't connect to postgreSQL container from another container

I have container with a NodeJS application and it has to be linked to another container with a Postgres db. My docker-compose.yml is: version: “3” services: postgres: image: “postgres:9.5.6-alpine” container_name: postgres volumes: – /shared_folder/postgresql:/var/lib/postgresql ports: – “5432:5432” web: build: . container_name: web ports: – “3000:3000” links: – postgres depends_on: – postgres command: sh /usr/home/freebsd/wait-for-command.sh -c […]

Postgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest one

Postgres container crash on launch with the following error message (project) ➜ project git:(feature/62-api-custom-image-categories) ✗ docker-compose up postgres Starting project_postgres_1 … Starting project_postgres_1 … done Attaching to project_postgres_1 postgres_1 | FATAL: database files are incompatible with server postgres_1 | DETAIL: The data directory was initialized by PostgreSQL version 9.5, which is not compatible with this […]

How to connect to the database in Docker in my case?

I am trying to connect to my postgres through docker containers. I have read a lots of posts but still can’t seem to resolve it. I ran the following command. docker run –name some-postgres -e POSTGRES_PASSWORD=mypw -d -p 5432:5432 postgres after that, I do docker inspect $(containerID) “NetworkSettings”: { “Bridge”: “”, “SandboxID”: “773de825919cb75482af47b85b1804f96a32bc6e9951cc0ea80752f880789717”, “HairpinMode”: false, […]

custom docker image is not running postgres

I am trying to create my own custom docker file for circleci v2. however, I am running into an issue where the postgres server is not running. I’ve run service postgresql start to no available. the message I’m getting is: psql: could not connect to server: Connection refused Is the server running locally and accepting […]

Best practice for rails docker-compose db:create db:migrate

I have simple rails application with docker-compose.yml file. It consists from two containers – db container with PostgreSQL and web container with rails app. In dockerfile for web part I have such lines in CMD CMD RAILS_ENV=production rake db:create db:migrate && \ bundle exec rails s -p 3000 -b ‘0.0.0.0’ –environment=production So in line rake […]

docker-compose exit depends_on service after tests

How do I get a service container to exit once the dependent container has finished? I have test suite running in the app_unittestbot container that depends_on a postgresql db server (postgres:9.5-alpine) running in separate container. Once the test suite exits, I want to check the return code of the test suite and halt the database […]

Error response from daemon: network bridge not found

I just got these messages after starting my docker service on ubuntu 14.04, and trying to starting the postgres container. $ docker start codeslave-postgres –> starting my container $ Error response from daemon: network bridge not found $ Error: failed to start containers: codeslave-postgres I was try to stop and restart docker service and also […]

java web app and Postgres on websphere-liberty

I’m deploying a working Tomcat webapp on websphere-liberty on docker. The webapp connects to a postgres data source on docker. In websphere when I try to get connection with DataSource ds = (DataSource)ctx.lookup(“java:comp/env/jdbc/postgres”); Connection conn = ds.getConnection(); my web.xml is setted as: <resource-ref> <description>postgreSQL Connection</description> <res-ref-name>jdbc/postgres</res-ref-name> <res-type>javax.sql.XADataSource</res-type> <res-auth>Container</res-auth> </resource-ref> I get the following error javax.naming.NamingException: […]

Solr running inside docker container is not connecting to PostgreSQL database

I have PostgreSQL and Solr, in a docker container, running on the same machine. I am trying to do a dataimport from Postgres into Solr, but I am getting errors. Here are the relevant parts of the log: Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT * FROM formulas org.postgresql.util.PSQLException: Connection to 127.0.0.1:5432 […]

Which way to run PostgeSQL in Docker?

Which of these methods is correct? One db container for each app One db container for all apps Install db without docker I tried to find information, but nothing. Or I badly searched?

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