Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17699
| From | alex <1j9448a02@lnx159sneakemail.com.invalid> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | docker: apache, php and mysql |
| Date | 2018-03-13 20:31 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <p898u7$lb0$1@gioia.aioe.org> (permalink) |
+ cat docker-compose.yml
version: '3.3'
services:
app:
build:
context: .
dockerfile: docker/Dockerfile
image: laravel-docker
ports:
- 4000:80
volumes:
- ./src:/var/www/html
links:
- mysql
- redis
environment:
DB_HOST: mysql
DB_DATABASE: test
DB_USERNAME: root
DB_PASSWORD: root
REDIS_HOST: redis
SESSION_DRIVER: redis
CACHE_DRIVER: redis
mysql:
image: mysql:5.7
ports:
- 13306:3306
environment:
MYSQL_DATABASE: test
MYSQL_USER: root
MYSQL_PASSWORD: root
MYSQL_ROOT_PASSWORD: root
volumes:
- ./dump.sql:/docker-entrypoint-initdb.d/dump.sql
redis:
image: redis:4.0-alpine
ports:
- 16379:6379
+ cat docker/Dockerfile
FROM php:7.2.2-apache
RUN docker-php-ext-install mbstring pdo pdo_mysql
+ cat src/index.php
<?php
error_reporting(255);
$pdo = new PDO(
'mysql:dbname=test;host=mysql',
'root',
'root'
);
+ docker-compose up -d --build
Building app
...
+ curl http://localhost:4000
<b>Fatal error</b>: Uncaught PDOException: SQLSTATE[HY000] [2002]
Connection refused in /var/www/html/index.php:7
Because it does not work?
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-13 20:31 +0100
Re: docker: apache, php and mysql Jerry Stuckle <jstucklex@attglobal.net> - 2018-03-14 17:15 -0400
Re: docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-15 09:08 +0100
Re: docker: apache, php and mysql Martin Gregorie <martin@mydomain.invalid> - 2018-03-15 12:31 +0000
Re: docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-15 14:38 +0100
Re: docker: apache, php and mysql Martin Gregorie <martin@mydomain.invalid> - 2018-03-15 14:56 +0000
Re: docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-15 17:41 +0100
Re: docker: apache, php and mysql MeV <michael.vilain@gmail.com> - 2018-03-15 11:03 -0700
Re: docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-15 19:14 +0100
Re: docker: apache, php and mysql Jerry Stuckle <jstucklex@attglobal.net> - 2018-03-15 14:16 -0400
Re: docker: apache, php and mysql alex <1j9448a02@lnx159sneakemail.com.invalid> - 2018-03-15 20:46 +0100
Re: docker: apache, php and mysql Percival John Hackworth <pjh@nanoworks.com> - 2018-03-15 16:41 -0700
Re: docker: apache, php and mysql Jerry Stuckle <jstucklex@attglobal.net> - 2018-03-15 20:33 -0400
csiph-web