Answer the question
In order to leave comments, you need to log in
How to properly forward the database from the docker to the outside?
Hello
I made a working configuration for myself for docker, laravel, nginx. I want to forward the database from the container to the outside so that the database is not deleted when the container is deleted, but after adding the standard directive, I ran into a problem, it doesn’t work, then docker-compose build gives the following:
docker-compose build
mysql uses an image, skipping
Building fpm
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
version: "3.3"
services:
nginx:
build:
context: .
dockerfile: docker/Nginx.Dockerfile
ports:
- 8098:80
links:
- fpm
volumes:
- ./laravel-docker:/var/www/laravel-docker
fpm:
build:
context: .
dockerfile: docker/Fpm.Dockerfile
volumes:
- ./laravel-docker:/var/www/laravel-docker
links:
- mysql
mysql:
image: mysql:5.7
ports:
- 33061:3306
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=laravel
volumes:
- ./database:/var/lib/mysql
Answer the question
In order to leave comments, you need to log in
mysql uses an image, skipping
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
docker-compose up -d
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question