小编cwa*_*ang的帖子

docker compose MySQL container [2002] Connection refused

I'm trying to build docker compose containers for Nginx + PHP(Laravel) + MySQL, but I keep getting Connection refused error

docker-compose.yml

version: "3"
services:

    nginx:
        image: nginx:latest
        ports:
            - '8080:80'
        volumes:
            - ./nginx:/etc/nginx/conf.d
            - ./logs/nginx:/var/logs/nginx
            - ./apps:/var/www/html
        depends_on:
            - php
        restart: always

    php:
        image: laradock/php-fpm:2.2-7.2
        volumes:
            - ./apps:/var/www/html
        restart: always
    mysql:
        image: mariadb
        ports:
            - '33060:3306'
        volumes:
            - ./db:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=root
        restart: always
Run Code Online (Sandbox Code Playgroud)

In ./apps I have a brand new Laravel app with basic SQL setup

All containers run …

mysql laravel docker

2
推荐指数
1
解决办法
3492
查看次数

标签 统计

docker ×1

laravel ×1

mysql ×1