GithubHelp home page GithubHelp logo

docker-env-sym4-psql's Introduction

Simple Docker Setup for Symfony development

Usage

Copy .env.dist to .env and edit to suit your requirements. docker-compose up --build to build the images and start up the whole cluster. From there on a simple docker-compose up is all you need. To shut it down open an second terminal and use docker-compose down to tear down the cluster. To also delete all local images use docker-compose down --rmi local. After that you need to rebuild the images.

The html directory is a bound volume to /var/www/html in the web server image. Document root is set to /var/www/html/web.

To put in your Symfony project do a git clone <project-url> html, go to the html directory and call composer install. When asked for the database settings use the ones defined in the docker-compose.yml file.

Using PostgreSQL with Symfony

Set database url in .env file

If you didn't change the credentials in docker-compose.yml, this should be your DATABASE_URL:

DATABASE_URL=mysql://pguser:pguserpw@pdb:5432/pgdb

Set database defaults in config/packages/doctrine.yaml

You only need to change the doctrine.dbal config, which should read like this:

doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_pgsql'
        charset: UTF-8

        # With Symfony 3.3, remove the `resolve:` prefix
        url: '%env(resolve:DATABASE_URL)%'

Accessing the cluster nodes

  • Webserver with PHP is under localhost
  • MySQL runs on localhost:3306
  • PostgreSQL runs on localhost:5432
  • Adminer runs on localhost:8080
  • Kibana can be found under localhost:81

Internals

Installed versions

  • PHP in version 7.1
  • Kibana in version 4 since version 5 still has issues with running in a docker container.

Packages installed

  • vim

PHP extensions installed

  • Core
  • ctype
  • curl
  • date
  • dom
  • fileinfo
  • filter
  • ftp
  • gd
  • hash
  • iconv
  • json
  • libxml
  • mbstring
  • mcrypt
  • mysqlnd
  • mysqli
  • OAuth
  • openssl
  • pcre
  • PDO
  • pdo_mysql
  • pdo_pgsql
  • pdo_sqlite
  • pgsql
  • Phar
  • posix
  • readline
  • Reflection
  • session
  • SimpleXML
  • soap
  • SPL
  • sqlite3
  • standard
  • tokenizer
  • xdebug
  • xml
  • xmlreader
  • xmlwriter
  • yaml
  • zip
  • zlib

docker-env-sym4-psql's People

Contributors

vgoebbels avatar

Stargazers

 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.