Skip to content

Instantly share code, notes, and snippets.

@RedLann
RedLann / access_postgresql_with_docker.md
Created July 8, 2020 12:19 — forked from MauricioMoraes/access_postgresql_with_docker.md
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@RedLann
RedLann / install.sh
Created November 28, 2017 17:36 — forked from meSingh/install.sh
Lemp stack for Ubuntu 16.04 (PHP7, Nginx, MongoDB, Git, Composer(with asset plugin))
#!/bin/bash
echo "Please, enter your username, it will be added to 'sudo' and 'docker' groups during the process."
read USERNAME
if [ -z "$USERNAME" ] ; then
echo "Exiting... Done."
exit
else
echo "Adding user to 'sudo' group..."