Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to DB #16

Open
SwithFr opened this issue Nov 27, 2018 · 0 comments
Open

Can't connect to DB #16

SwithFr opened this issue Nov 27, 2018 · 0 comments

Comments

@SwithFr
Copy link

SwithFr commented Nov 27, 2018

Hi!

I'm probably stupid but I can't connect to the database with laravel. What should I put in the .env file?
I've tried everything:

  • port tested: 5432
  • host tested: localhost, 127.0.0.0.1, pgsql

this is my docker-composer:

services:

  php:
    image: swithfr/php:7.2
    volumes:
      - ".:/var/www/laratest"

  nginx:
    image: nginx:latest
    volumes:
      - "./docker/nginx.conf:/etc/nginx/conf.d/default.conf"
    links:
      - php
    ports:
      - 8888:80

  pg-master:
      image: swithfr/pgsql-replication
      restart:'always'.
      environment:
        POSTGRES_USER: "postgres
        POSTGRES_PASSWORD:'postgres'.
        PGDATA:'/var/lib/postgresql/data/pgdata'
      volumes:
       - '/var/lib/postgresql/data'
      exposes:
       - '5432'

  pg-slave:
    image: swithfr/pgsql-replication
    restart:'always'.
    environment:
      POSTGRES_USER: "postgres
      POSTGRES_PASSWORD:'postgres'.
      PGDATA:'/var/lib/postgresql/data/pgdata'
      REPLICATE_FROM: "pg-master
    volumes:
     - '/var/lib/postgresql/data'
    exposes:
     - '5432'
    links:
     - "pg-master

swithfr/pgsql-replication is a copy of your Dockerfile with just the addition of these lines

RUN apt-get update 
RUN apt-get install iputils-ping -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant