This docker-compose use php-fpm, nginx (HTTP+HTTPS/2), MySQL and Mailhog.
Put this repository files in a .docker
folder in/outside your project or put it a the root of it (default behaviour)
cp .env.dist .env
docker-compose up -d --build
- PHP :
- php://localhost:9000 or php://127.0.0.1:9000
- Web server :
- Mailhog :
- http://localhost:8025 or http://127.0.0.1:8025
- smtp://localhost:1025 or smtp://127.0.0.1:1025
- MySQL :
- mysql://localhost:3306 or mysql://127.0.0.1:3306
Put this repository files in a .docker
folder in/outside your project or put it a the root of it (default behaviour)
The first thing to do is to copy the .env.dist
file to a .env
file, then fill in the value you want to be changed.
cp .env.dist .env
Change the values in .env
following the instructions in it
The build process will first build nginx and add the necessary vhost, build composer+php-fpm together building and adding necessary php-extensions with configurations (with specific configuration by PROJECT_TYPE)
docker-compose build
All containers will be launch and ports will be available on loopback network
docker-compose up -d
This configuration has a specific php configuration and a vhost file. Plus, you can keep /var/*
folders in the
container to avoid some performances issues on Windows for exemple. If you want to use use this environement vars :
PROJECT_TYPE=symfony-flex
# If you want to add other php extensions, uncomment the line bellow
# multiple extensions should be seperated by a space
# APP_PHP_EXTRA_EXTENSIONS=exif
@TODO
This configuration has a specific php configuration and a vhost file. Plus, you can keep /app/*
folders in the
container to avoid some performances issues on Windows for example. If you want to use use this environment vars :
PROJECT_TYPE=symfony-2
NGINX_WEB_INDEX_FILE=app_dev.php
# If you want to add other php extensions, uncomment the line bellow
# multiple extensions should be seperated by a space
# APP_PHP_EXTRA_EXTENSIONS=exif
@TODO
This configuration has a specific php configuration and a vhost file. If you want to use use this environment vars :
PROJECT_TYPE=wordpress
NGINX_WEB_FOLDER=
# If you want to add other php extensions, uncomment the line bellow
# multiple extensions should be seperated by a space
# APP_PHP_EXTRA_EXTENSIONS=exif
docker-compose -f ./.docker/docker-compose.yaml -f ./.docker/docker-compose.capistrano.yaml --env-file .env \
cp nginx:/etc/ssl/certs/server-localhost.crt .docker/config/nginx/ssl/certs/server.crt
sudo security add-trusted-cert -d -r trustRoot ./.docker/config/nginx/ssl/certs/server.crt
Build it like this, your private ssh key have to in your ~/.ssh
directory (or define an other ssh
key directory to use) :
docker-compose -f ./docker-compose.capistrano.yaml build
Rq: bundle install
is made on first up
or every run
if and only if a Gemfile is present at the root
of ${PROJECT_DIR}
up
and exe
it (if you want to exec
it many time this is better than only run
) :
docker-compose -f ./docker-compose.capistrano.yaml up -d
docker-compose -f ./docker-compose.capistrano.yaml exec capistrano cap stagging deploy
or run it
docker-compose -f ./docker-compose.capistrano.yaml run capistrano cap stagging deploy
@TODO