Let’s say that it’s 2019 and for some odd reason you need to setup a PHP dev env
First, let’s start a postgres service.
This docker container has to have a name.
my-postgres in this case. It will be used
To connect a client to postgres, we can run
--link my-postgres will make
my-postgres DNS points to the IP of
Then we say to
psql connect to
Now we can run the
First, go to your working dir
See that we are connecting the
Now you can connect to
http://localhost:8000 and see your awesome app.
For PHP reaons, PHP will not stop with
To stop this container, we need to run
docker kill my-php
Conexao Postgres utilizndo pHP
Insere um dado em uma tabela