README.md

    Docker-Symfony-Redis-Postgres-Nginx

    Simple docker env, for local development.

    About build:

    • composer (Dockerfile, project-init and start-entrypoint scripts)

      load clean symfony project template skeleton if not exists in ./app, or update vendor

    • app (Dockerfile and start-entrypoint)

      run after pre-build stage, create symfony-fpm container and serve by php-fpm (load www.conf, and php.ini from ./php)

    • cache (redis-alpine)
    • web (nginx-alpine)

      edit default.config.template in ./nginx/templates/

    • adm (adminer)

      works with mysql, postgres etc (change driver before login)

    • db (postgres:alpine)
    • example ‘.env’ config for build

      .env holds all build env every service (overrites symfony .env file)


    Pre-build stage

    Before run you should install docker on your PC.

    How install docker, official docs

    Checkout docker already installed, just run in terminal and you get docker version info

    docker -v
    

    Run composer service before and load symfony project source (build composer image and load empty symfony project)

    docker compose up -d composer
    

    Then remove composer service final pre-build stage

    docker compose down --remove-orphans
    

    Workflow

    Run docker compose up

    docker compose up -d
    

    And now checkout in browser:

    Adminer if want edit database manually

    Nginx proxy for services (symfony-app)

    Symfony official framework info

    Symfony access on default port nginx, but serve by php-fpm server, settings edit in www.conf in ./php


    Permission problem

    You can add root access for your user (host machine)

    sudo chown -R [user-name]:www-data /path/to/your/local/folder
    

    Add full permission for your user, use command as root (sudo).

    -R flag (recursive run).

    Or just add your user into www-data group (creates if not exist) and edit app files freely

    sudo usermod -a -G www-data username
    

    How return default permission

    sudo chown -R www-data /path/to/your/local/folder
    

    This will return all back, use command as root (sudo).

    -R flag (recursive run).


    Help tools

    Конвейеры
    0 успешных
    0 с ошибкой