Dependencies:
- Docker engine v1.13 or higher. Your OS provided package might be a little old, if you encounter problems, do upgrade. See https://docs.docker.com/engine/installation
- Docker compose v1.12 or higher. See docs.docker.com/compose/install
Once you're done, simply cd
to your project and run docker-compose up -d
. This will initialise and start all the containers, then leave them running in the background.
You can access your application via localhost
, if you're running the containers directly, or through `` when run on a vm. nginx and mailhog both respond to any hostname, in case you want to add your own hostname on your /etc/hosts
Service|Address outside containers
------|---------|-----------
Webserver|localhost:7897
MariaDB|host: localhost
; port: 6670
You'll need to configure your application to use any services you enabled:
Service | Hostname | Port number |
---|---|---|
php-fpm | php-fpm | 9000 |
MariaDB | mariadb | 3306 (default) |
Memcached | memcached | 11211 (default) |
Redis | redis | 6379 (default) |
ClickHouse | clickhouse | 9000 (HTTP default) |
Note: you need to cd first to where your docker-compose.yml file lives.
- Start containers in the background:
docker-compose up -d
- Start containers on the foreground:
docker-compose up
. You will see a stream of logs for every container running. - Stop containers:
docker-compose stop
- Kill containers:
docker-compose kill
- View container logs:
docker-compose logs
- Execute command inside of container:
docker-compose exec SERVICE_NAME COMMAND
whereCOMMAND
is whatever you want to run. Examples: * Shell into the PHP container,docker-compose exec php-fpm bash
* Run symfony console,docker-compose exec php-fpm bin/console
* Open a mysql shell,docker-compose exec mysql mysql -uroot -pCHOSEN_ROOT_PASSWORD
- Connect to clickhouse client
docker-compose exec --user="root" clickhouse clickhouse --client