All Projects → StaffNowa → docker-symfony

StaffNowa / docker-symfony

Licence: MIT license
Docker Symfony (PHP-FPM - NGINX - MySQL - MailHog - Redis - RabbitMQ)

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-symfony

Docker Magento Mutagen
Mage2click Docker-based development environment for Magento with mutagen.io sync for files on macOS
Stars: ✭ 64 (+100%)
Mutual labels:  rabbitmq, mariadb, ngrok
dockerX
Examples of amazing Docker/Docker-Compose/Docker Swarm technologies
Stars: ✭ 17 (-46.87%)
Mutual labels:  rabbitmq, mariadb
Gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Stars: ✭ 398 (+1143.75%)
Mutual labels:  rabbitmq, mariadb
symfony-docker
A template for new Symfony applications using Docker: ./install.sh && 🚀
Stars: ✭ 34 (+6.25%)
Mutual labels:  docker-symfony, symfony-application
easydock
Dockerize your PHP apps ;)
Stars: ✭ 52 (+62.5%)
Mutual labels:  mariadb, mailhog
Testcontainers Spring Boot
Container auto-configurations for spring-boot based integration tests
Stars: ✭ 460 (+1337.5%)
Mutual labels:  rabbitmq, mariadb
Neard
🎲 Portable WAMP software stack
Stars: ✭ 296 (+825%)
Mutual labels:  yarn, mariadb
banditore
Banditore retrieves new releases from your starred GitHub repositories and generate an Atom feed with them.
Stars: ✭ 118 (+268.75%)
Mutual labels:  rabbitmq, symfony-application
manager
OVHcloud Control Panel
Stars: ✭ 153 (+378.13%)
Mutual labels:  yarn
upgreat
CLI for a painless way to upgrade your package.json dependencies!
Stars: ✭ 47 (+46.88%)
Mutual labels:  yarn
spring-boot-examples
本仓库为《Spring Boot 系列文章》代码仓库,欢迎点赞、收藏。
Stars: ✭ 52 (+62.5%)
Mutual labels:  rabbitmq
api.symfony-3.crud
Symfony 3 and FOS REST Bundle - CRUD API
Stars: ✭ 15 (-53.12%)
Mutual labels:  symfony-application
Sample-ConsoleService
A sample .NET Core 2.2 Console Service
Stars: ✭ 33 (+3.13%)
Mutual labels:  rabbitmq
Tutorial-Echobot
Un Bot de Facebook Messenger que te responde lo que tú escribiste.
Stars: ✭ 25 (-21.87%)
Mutual labels:  ngrok
LearningPoint
A repository for learning different technologies, frameworks, features......
Stars: ✭ 66 (+106.25%)
Mutual labels:  rabbitmq
ncolony
A colony of interacting processes
Stars: ✭ 23 (-28.12%)
Mutual labels:  supervisor
Cloud-Native-App-Spring-Boot
A Cloud Native App with Spring Coud Security with KeyCloak Auth Server, API Gateway Server, Naming Server, Config Server and Distributed Tracing and ELK Stack hosted in K8s
Stars: ✭ 19 (-40.62%)
Mutual labels:  rabbitmq
UmaSupporter.WebClient
🏃🏽‍♀️ 우마무스메 육성 도우미 '우마서포터'의 프론트엔드 애플리케이션입니다.
Stars: ✭ 14 (-56.25%)
Mutual labels:  yarn
nyx
Lean linux and OSX process monitoring written in C
Stars: ✭ 24 (-25%)
Mutual labels:  supervisor
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (+93.75%)
Mutual labels:  ngrok

Docker for Symfony (PHP-FPM - NGINX - MySQL)

Docker symfony gives you everything you need for developing Symfony application. This complete stack run with docker and docker-compose.

Installation

Install the latest Docker CE version

If you are running on Linux:

curl -fsSL https://get.docker.com -o get-docker.sh &&
sh get-docker.sh

If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like:

sudo usermod -aG docker ${USER}

Install the latest Docker Compose

If you are running on Linux:

sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose

Install PWGen

Debian / Ubuntu

sudo apt-get install pwgen

CentOS

wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/pwgen-2.08-1.el7.x86_64.rpm && rpm -ivh pwgen-2.08-1.el7.x86_64.rpm

Configuration

  1. Create a .env from the .env.dist file. Adapt it according to your symfony application

    cp .env.dist .env
  2. Build / run containers

    ./d4d start
    
  3. Update your system host file (add symfony.local)

    # UNIX only: get containers IP address and update host (replace IP according to your configuration)
    $ sudo echo $(docker network inspect bridge | grep Gateway | grep -o -E '[0-9\.]+') "symfony.local" >> /etc/hosts

    Note: For OS X, please take a look here.

  4. Prepare Symfony app

    1. Get your logins to access MySQL server ./d4d passwd show

    2. Update

      a) SF2, SF3: app/config/parameters.yml

      # ./project/app/config/parameters.yml
      parameters:
          database_host:     mysql
          database_port:     ~
          database_name:     db_name
          database_user:     db_user
          database_password: db_password (random password)
      

      b) SF4, SF5, SF6: .env

      DATABASE_URL=mysql://db_user:db_password@mysql:3306/db_name
      MAILER_URL=smtp://mailhog:1025
      
    3. Composer install & create database

      $ docker-compose exec php bash
      $ composer create-project symfony/website-skeleton my-project
          
      # Symfony 2
      $ sf doctrine:database:create
      $ sf doctrine:schema:update --force
      # Only if you have `doctrine/doctrine-fixtures-bundle` installed
      $ sf doctrine:fixtures:load --no-interaction
          
      # Symfony 3
      $ sf3 doctrine:database:create
      $ sf3 doctrine:schema:update --force
      # Only if you have `doctrine/doctrine-fixtures-bundle` installed
      $ sf3 doctrine:fixtures:load --no-interaction
      
      # Symfony 4
      $ sf4 doctrine:database:create
      $ sf4 doctrine:schema:update --force
      # Only if you have `doctrine/doctrine-fixtures-bundle` installed
      $ sf4 doctrine:fixtures:load --no-interaction
      
      # Symfony 5
      $ sf5 doctrine:database:create
      $ sf5 doctrine:schema:update --force
      # Only if you have `doctrine/doctrine-fixtures-bundle` installed
      $ sf5 doctrine:fixtures:load --no-interaction
      
      # Symfony 6
      $ sf6 doctrine:database:create
      $ sf6 doctrine:schema:update --force
      # Only if you have `doctrine/doctrine-fixtures-bundle` installed
      $ sf6 doctrine:fixtures:load --no-interaction
  5. Enjoy :-)

    Usage

    Just run ./d4d start, then:

    How it works?

    Have a look at the docker-compose.yml file, here are the docker-compose built images:

    • nginx: Nginx is one of the most popular web servers in the world and responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or reverse proxy.
    • php: PHP is a popular general-purpose scripting language that is especially suited to web development.
    • mysql: MySQL is the most popular relational database management system.
    • phpmyadmin: phpMyAdmin was created so that users can interact with MySQL / MariaDB through a web interface.
    • mailhog: MailHog is an email testing tool for developers.
    • redis: Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

    This results in the following running containers:

    $ docker-compose ps
               Name                          Command               State                       Ports                     
    ---------------------------------------------------------------------------------------------------------------------
    docker-symfony_mailhog_1      MailHog                          Up      0.0.0.0:1025->1025/tcp, 0.0.0.0:8025->8025/tcp
    docker-symfony_mysql_1        docker-entrypoint.sh --cha ...   Up      0.0.0.0:3306->3306/tcp                        
    docker-symfony_nginx_1        nginx -g daemon off;             Up      0.0.0.0:80->80/tcp                            
    docker-symfony_php_1          docker-php-entrypoint php-fpm    Up      9000/tcp                                      
    docker-symfony_phpmyadmin_1   /docker-entrypoint.sh apac ...   Up      0.0.0.0:8080->80/tcp                          
    docker-symfony_redis_1        docker-entrypoint.sh redis ...   Up      6379/tcp          

JetBrains support us!

Hostinger.lt support us!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].