mtmacdonald / docker-laravel

A Docker container for Laravel web apps
MIT License
122 stars 33 forks source link

Used postgresql but.. #11

Open hopewise opened 8 years ago

hopewise commented 8 years ago

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: image: mdillon/postgis volumes:

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?