docker-laravel icon indicating copy to clipboard operation
docker-laravel copied to clipboard

Used postgresql but..

Open hopewise opened this issue 9 years ago • 0 comments

Hello,

To use postgres, I had to start from another ubutnu image:

FROM sameersbn/postgresql:9.4-12

and at the end of the Dockerfile, I added:

apt-get update
apt-get install php5-pgsql

but the resulted container said:

SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "postgis" (172.17.0.2) and accepting TCP/IP connections on port 54320?

in my .env file I used:

DB_HOST=postgis

Although I am linking to the postgis image as:

laravel: image: docker-laravel-postgres links: - postgis:postgis

postgis: image: mdillon/postgis volumes: - C:\Users\Samir Sabri\Documents\postgis-data-folder:/var/lib/postgresql/data10

env_file: .postgis_env

ports:
    - "9090:9000"
    - "54320:5432"
container_name: postgis-db

the only way was to use my docker api url 192.168.99.100 as:

DB_HOST=192.168.99.100

Any idea?

hopewise avatar Feb 18 '16 09:02 hopewise