2017 © Pedro Peláez
 

project docker-symfony

Symfony Flex application skeleton with docker-compose support

image

covex-nn/docker-symfony

Symfony Flex application skeleton with docker-compose support

  • Friday, July 13, 2018
  • by covex-nn
  • Repository
  • 6 Watchers
  • 22 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 17 Versions
  • 130 % Grown

The README.md

Symfony Flex application skeleton with docker support

This repository is a skeleton of Symfony Flex application for development and deployment with docker-compose. It contains a set of GitLab CI/CD Pipeline procedures for almost zero deployment downtime., (*1)

Only trusted base docker images are used at all stages from development to production:, (*2)

  • nginx:1.14
  • debian:stretch-slim with Sury Debian DPA for PHP
  • mysql:5.7
  • phpmyadmin/phpmyadmin

This repository is a symfony/skeleton composer project, bootstrapped by [Environment configurator][3] with the following commands:, (*3)

composer global require covex-nn/environment
composer global require covex-nn/environment-repository
composer create-project symfony/skeleton .
composer env:apply docker-ci

Usage

Use composer to create a new Symfony Flex application:, (*4)

composer create-project covex-nn/docker-symfony .

Before launching docker-compose, add two records to C:\WINDOWS\System32\Drivers\etc\hosts or /etc/hosts file:, (*5)

docker.local 127.0.0.1
mysql 127.0.0.1

If you use Docker Toolbox, execute docker-machine env, get IP-address from DOCKER_HOST variable and use that IP instead of 127.0.0.1, (*6)

To initialize and run a new application with PHP-builtin web-server use following commands (only MySQL and phpMyAdmin will be started with docker-compose):, (*7)

docker-compose up -d
phing
php -S localhost:80 -t public

But if you want to use Nginx as Web server, or if you do not have PHP 7.2 installed on your host, execute the following instead:, (*8)

cp docker-compose.override.yml.dist docker-compose.override.yml
docker-compose up -d
docker-compose exec php phing

Endpoint container with php-fpm is built with multi-stage Dockerfile. PHP extensions intl, pdo_mysql, zip, opcache and xdebug (for dev-environment) are installed by default, but a list of PHP extensions can be easily extended with simple apt-get., (*9)

  • cron is installed for prod-environment; add your crontab jobs to docker/app.crontab., (*10)

  • cache and log directories are moved to a non-shared volume for dev-environmen with volumes section of docker-compose.override.yml, (*11)

The Versions