amsdard/symfony-as-docker

Installs: 1 072

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:Shell

v1.2.4 2019-02-15 07:42 UTC

This package is not auto-updated.

Last update: 2024-12-14 10:57:23 UTC


README

implement Docker into your Symfony (^4.0) project using flex

Requirements

Install (when you have already an existing project)

In your project directory, download the package by composer (or git clone to your ~/Projects directory)

composer require amsdard/symfony-as-docker
  • php+nginx mode (default)
./vendor/amsdard/symfony-as-docker/setup
  • apache mode
./vendor/amsdard/symfony-as-docker/setup apache

in case of apache mode, You may also need:

composer require symfony/apache-pack

Install - Full sample (when you install a new project)

In your ~/Projects directory, create a new project (a new my_project directory will be created)

composer create-project symfony/skeleton my_project

Go to your ~/Projects/my_project and run the following command to allow using a community contrib

composer config extra.symfony.allow-contrib true

install basic Symfony components

composer require annotations validator encore asset translator security debug-pack make

install as-docker

composer require amsdard/symfony-as-docker
./vendor/amsdard/symfony-as-docker/setup

run the project

yake yarn install
yake configure
yake up

now you can run yake console make:controller Home and go to http://my_project.test/home

How it works

  • below file structure will be installed
.
├── README.md
├── docker-compose.yml
├── Yakefile
├── deploy
│   ├── prod
│   │   └── docker-compose.yml
│   └── rancher
│       └── docker-compose.yml
└── docker
    ├── mysql
    │   ├── config.env
    │   └── config.env.dist
    ├── nginx
    │   ├── Dockerfile
    │   └── default.conf
    └── php
        └── Dockerfile
  • your project directory name will be filled as local domain name and docker image namespace (see docker-compose.yml)
  • new rules will be added to your .gitignore file:
    • /composer.phar internal project composer
    • /docker/*/*.env container ENV