Coder Social home page Coder Social logo

henryvoorburg / docker-apache-php-symfony Goto Github PK

View Code? Open in Web Editor NEW

This project forked from systemsdk/docker-apache-php-symfony

0.0 0.0 0.0 2.34 MB

Docker environment required to run Symfony (based on official php and mysql docker hub repositories)

Dockerfile 7.42% Makefile 10.04% PHP 74.75% Shell 4.58% Smarty 2.30% Twig 0.91%

docker-apache-php-symfony's Introduction

PHP symfony environment

Docker environment required to run Symfony (based on official php and mysql docker hub repositories).

Actions Status CircleCI Coverage Status

Source code

Requirements

  • Docker version 18.06 or later
  • Docker compose version 1.22 or later
  • An editor or IDE
  • MySQL Workbench

Note: OS recommendation - Linux Ubuntu based.

Components

  1. Apache 2.4
  2. PHP 8.0 (Apache handler)
  3. MySQL 8
  4. Symfony 5
  5. RabbitMQ 3

Setting up PROD environment

1.Clone this repository from GitHub.

2.Edit docker-compose-prod.yml and set necessary user/password for MySQL and RabbitMQ.

Note: Delete var/mysql-data folder if it is exist.

3.Edit env.prod and set necessary user/password for MySQL and RabbitMQ.

4.Build, start and install the docker images from your terminal:

make build-prod
make start-prod

5.Make sure that you have installed migrations / messenger transports:

make migrate-no-test
make messenger-setup-transports

Setting up STAGING environment

1.Clone this repository from GitHub.

Note: Delete var/mysql-data folder if it is exist.

2.Build, start and install the docker images from your terminal:

make build-staging
make start-staging

3.Make sure that you have installed migrations / messenger transports:

make migrate-no-test
make messenger-setup-transports

Setting up DEV environment

1.Clone this repository from GitHub.

2.Set another APP_SECRET for application in .env.prod and .env.staging files.

Note 1: You can get unique secret key for example here.

Note 2: Do not use .env.local.php on dev and test environment (delete it if exist).

Note 3: Delete var/mysql-data folder if it is exist.

3.Add domain to local 'hosts' file:

127.0.0.1    localhost

4.Configure /docker/dev/xdebug.ini (optional):

  • In case you need debug only requests with IDE KEY: PHPSTORM from frontend in your browser:
xdebug.start_with_request = no

Install locally in Firefox extension "Xdebug helper" and set in settings IDE KEY: PHPSTORM

  • In case you need debug any request to an api (by default):
xdebug.start_with_request = yes

5.Build, start and install the docker images from your terminal:

make build
make start
make composer-install

6.Make sure that you have installed migrations / messenger transports:

make migrate
make messenger-setup-transports

7.In order to use this application, please open in your browser next url: http://localhost.

Getting shell to container

After application will start (make start) and in order to get shell access inside symfony container you can run following command:

make ssh

Note 1: Please use next make commands in order to enter in other containers: make ssh-supervisord, make ssh-mysql, make ssh-rabbitmq.

Note 2: Please use exit command in order to return from container's shell to local shell.

Building containers

In case you edited Dockerfile or other environment configuration you'll need to build containers again using next commands:

make stop
make build
make start

Note 1: Please use next command if you need to build staging environment make build-staging instead make build.

Note 2: Please use next command if you need to build prod environment make build-prod instead make build.

Start and stop environment

Please use next make commands in order to start and stop environment:

make start
make stop

Note 1: For staging environment need to be used next make commands: make start-staging, make stop-staging.

Note 2: For prod environment need to be used next make commands: make start-prod, make stop-prod.

Additional main command available

make build
make build-test
make build-staging
make build-prod

make start
make start-test
make start-staging
make start-prod

make stop
make stop-test
make stop-staging
make stop-prod

make restart
make restart-test
make restart-staging
make restart-prod

make env-staging
make env-prod

make ssh
make ssh-supervisord
make ssh-mysql
make ssh-rabbitmq

make composer-install-no-dev
make composer-install
make composer-update

make info

make logs
make logs-supervisord
make logs-mysql
make logs-rabbitmq

make drop-migrate
make migrate
make migrate-no-test

make fixtures

make messenger-setup-transports

make phpunit
make report-code-coverage

make phpcs
make ecs
make ecs-fix
make phpmetrics
make phpcpd
make phpmd
make phpstan
make phpinsights

etc....

Notes: Please see more commands in Makefile

Architecture & packages

Guidelines

Working on your project

  1. For new feature development, fork develop branch into a new branch with one of the two patterns:
    • feature/{ticketNo}
  2. Commit often, and write descriptive commit messages, so its easier to follow steps taken when reviewing.
  3. Push this branch to the repo and create pull request into develop to get feedback, with the format feature/{ticketNo} - "Short descriptive title of Jira task".
  4. Iterate as needed.
  5. Make sure that "All checks have passed" on CircleCI(or another one in case you are not using CircleCI) and status is green.
  6. When PR is approved, it will be squashed & merged, into develop and later merged into release/{No} for deployment.

docker-apache-php-symfony's People

Contributors

dimadeush avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.