Code Monkey home page Code Monkey logo

postgresql-playground's Introduction

Prerequisites (Linux + docker only)

  • Make sure you resolve pgadmin.postgres.local as 127.0.0.1
echo "127.0.0.1 pgadmin.postgres.local" >> /etc/hosts
echo "127.0.0.1 phpapp.postgres.local" >> /etc/hosts

Set-up docker application environment

Create new .env file, copy content from .env.dist

cd /YOUR_PROJECT_DIRECTORY/docker
cp .env.dist .env

Edit docker/.env and replace:

NGINX_PORT_TO_EXPOSE with the port you want to expose
POSTGRES_PORT_TO_EXPOSE with the port you want to expose
SYMFONY_APP_PATH with the root location of your symfony application
SYMFONY_CACHE_DIR with the root dor for symfony cache (change this to "/tmp" when using VM for performance reasons)

In case of conflicts with the local environment it is suggested to change port mapping of nginx and postgresql to different than default.

Setting up local vagrant environment (Windows only)

Step 1: Install Virtualbox (https://www.virtualbox.org/)

Step 2: Install vagrant (https://www.vagrantup.com/)

Step 3: Install vagant plugins

vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-hostmanager

Step 4: Launch Vagrant Box

cd vagrant
vagrant up 
vagrant ssh

PgAdmin web interface

PostgreSQL access (from PgAdmin interface)

  • Server: postgres
  • Port: see POSTGRES_PORT_TO_EXPOSE in the .env file
  • User: web
  • Password: web
  • Database: web

PostgreSQL access (from outside of docker/vagrant)

  • Server: localhost
  • Docker Port: see POSTGRES_PORT_TO_EXPOSE in the .env file
  • Vagrant Port: 5432
  • User: web
  • Password: web
  • Database: web

PHP Applicatioin web interface

PHP Applicatioin CLI shell

cd /YOUR_PROJECT_DIRECTORY/docker
docker-compose exec phpapp bash

Starting docker application

cd /YOUR_PROJECT_DIRECTORY/docker 
./start_containers.sh

Stopping docker application

cd /YOUR_PROJECT_DIRECTORY/docker
./stop_containers.sh

Rebuilding docker application

cd /YOUR_PROJECT_DIRECTORY/docker
./stop_containers.sh

postgresql-playground's People

Watchers

James Cloos avatar ChieftainY2k 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.