covex-nn / docker-symfony
Symfony Flex application skeleton with docker-compose support
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 38
Watchers: 8
Forks: 14
Open Issues: 1
Type:project
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- doctrine/doctrine-bundle: ^1.8
- doctrine/doctrine-migrations-bundle: ^1.3
- doctrine/orm: ^2.6
- symfony/console: ^4.1
- symfony/flex: ^1.0
- symfony/framework-bundle: ^4.1
- symfony/lts: ^4@dev
- symfony/yaml: ^4.1
Requires (Dev)
- symfony/dotenv: ^4.1
- symfony/phpunit-bridge: ^4.0
Conflicts
README
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.
Only trusted base docker images are used at all stages from development to production:
nginx:1.14
debian:stretch-slim
with Sury Debian DPA for PHPmysql:5.7
phpmyadmin/phpmyadmin
This repository is a symfony/skeleton
composer project, bootstrapped by
Environment configurator with the following commands:
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:
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:
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
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
):
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:
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
.
-
cron
is installed for prod-environment; add your crontab jobs todocker/app.crontab
. -
cache
andlog
directories are moved to a non-shared volume for dev-environmen withvolumes
section of docker-compose.override.yml