GithubHelp home page GithubHelp logo

symfony-docker-compose's Introduction

Symfony Docker Compose

Docker compose environment for Symfony (also works for Laravel or plain PHP) projects

Summary of what is included

  • PHP 8.2 with XDEBUG 3
  • Apache2
  • MySQL 8.0
  • PhpMyAdmin - manage MySQL
  • Mailhog - local mailing server
  • Installs composer command
  • Virtualhost configuration dedicated for Symfony projects

How to install this in my project?

  • Download .docker folder and docker-compose.yml file and add them to your project (Skip .github and public folders)
  • Run docker compose up command from your terminal. (Install docker compose)

How to access everything?

By default you can access services via:

Modifying .env file (If you are using Symfony)

If you use default IP addresses, append your .env file with the following:

  • For database connection -DATABASE_URL=mysql://project:project@mysql:3306/project
  • For mailing server - MAILER_URL=mailhog:1025//[email protected]:randompassword (You can you any email and password)

MySQL

  • You can connect to your MySQL via localhost:3306
  • If you don't have any additional software, you can connect to database via phpmyadmin (http://localhost:81)
  • Username: project
  • Password: project
  • Default table is called project

Notes and common issues

  • I use this configuration on Windows 11 with WSL 2
  • You cannot use same container_name for multiple projects. Make sure to change them, or you can just delete that optional argument from docker-compose.yml file
  • You can't run multiple projects that allocate same ports on your localhost.
  • If you can't compose a new project, you might need to delete your old docker networks. Type docker network ls and then remove your old project network by writing docker network rm NETWORK_ID (for example docker network rm 528d8c753c17)
  • cannot start service XXX: network YYY not found. Open up container list with docker container ls -a and remove old containers with docker container rm ID.

Something does not work?

Please create an issue.

symfony-docker-compose's People

Contributors

nelkasovic avatar

Watchers

 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.