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

How to connect to the DB? #4

Open
paulcanning opened this issue Feb 5, 2018 · 2 comments
Open

How to connect to the DB? #4

paulcanning opened this issue Feb 5, 2018 · 2 comments

Comments

@paulcanning
Copy link

How exactly do I connect to the DB after the docker is running?

@hansin91
Copy link

I combined this project and opencart, but when i register account, 504 timeout nginx. How should I do ?. Thank you

@andreshg112
Copy link

Add ports to the db service:

version: "2"
services:
  nginx:
      build:
          context: ./nginx
      ports:
          - "8080:80"
      volumes:
          - ./app:/var/app
  fpm:
      build:
          context: ./fpm
      volumes:
          - ./app:/var/app
      expose:
          - "9000"
      environment:
          - "DB_HOST=db"
          - "DB_DATABASE=laravel"
  db:
      image: mariadb:10.4.12
      ports:
          - "3306:3306"
      environment:
          - MYSQL_ROOT_PASSWORD=root
          - MYSQL_DATABASE=laravel
      volumes:
          - ./database:/var/lib/mysql

Then you can connect using:
mysql -u root -p

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

3 participants