Code Monkey home page Code Monkey logo

symfony-webapp-docker-dev's Introduction

Docker Setup for Symfony 6.3.* Web Apps

Docker containers for traditional Symfony 6.3.* web apps, i.e., apps that you would usually create using the --webapp Symfony CLI option or the composer require webapp command.

What is inside

  • Nginx webserver
  • PHP 8.2 (with composer)
  • MySQL 8.0
  • phpMyAdmin

Local dev guide (Linux)

  1. Clone the repo:
    git clone https://github.com/TOA-Anakin/symfony-webapp-docker-dev.git
  2. Rename the cloned repo as desired:
    mv symfony-webapp-docker-dev your_project_name
  3. Find your user ID using the id -u command and update the .docker/.env file accordingly.
  4. cd into the .docker directory and build the Docker containers:
    cd your_project_name/.docker
    docker compose up -d --build
    Before the end of the process you should see a list of newly created (now running) containers:
    [+] Running 6/6
    ✔ Network symfony_webapp_docker_symfony_app
    Created                                         0.1s 
    ✔ Volume "symfony_webapp_docker_db_app"
    Created                                         0.0s 
    ✔ Container symfony_webapp_docker-phpmyadmin-1
    Started                                         0.2s 
    ✔ Container symfony_webapp_docker-php-1
    Started                                         0.2s 
    ✔ Container symfony_webapp_docker-db-1
    Started                                         0.2s 
    ✔ Container symfony_webapp_docker-nginx-1
    Started                                         0.2s 
  5. Open the terminal of the PHP container (mine is named symfony_webapp_docker-php-1) and create a Symfony skeleton project using composer:
    docker exec -it symfony_webapp_docker-php-1 bash
    composer create-project symfony/skeleton:"6.3.*" tmp_dir
    Move the contents of temp_dir into the project root:
    mv tmp_dir/* . && mv tmp_dir/.[!.]* . && rmdir tmp_dir
    Install Symfony web app packages:
    composer require webapp
    Note: If you are prompted with a question Do you want to include Docker configuration from recipes?, answer n [No].
  6. Access your Symfony web app at http://localhost, phpMyAdmin is accessible at http://localhost:8081

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.