Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 2.71 KB

README.md

File metadata and controls

85 lines (64 loc) · 2.71 KB

Postgres and PGAdmin setup with Docker

Setup of docker

You need to have, on your server, the installed docker. The installation can be done with an official script, following the following steps:

  • Download the docker
curl -fsSL https://get.docker.com -o get-docker.sh
  • run the script
sh get-docker.sh
  • Give permissions to execute the Docker command to your user
sudo usermod -aG docker $USER
  • Remove the installation script
rm get-docker.sh

Setup of proxy

Follow the instructions of this repository:

https://github.com/LibreCodeCoop/nginx-proxy

Before first run

Copy the .env.example to .env and set the values.

cp .env.example .env
Environment service Description
VIRTUAL_HOST web Your domain
LETSENCRYPT_HOST web Your domain
LETSENCRYPT_EMAIL web Your sysadmin email
POSTGRES_PASSWORD postgres Password for the PostgreSQL database superuser. Should be changed from default for security.
POSTGRES_DB postgres Name of the default database that is created when the PostgreSQL image is first started.
POSTGRES_USER postgres Username for the PostgreSQL database superuser.
PGADMIN_DEFAULT_EMAIL pgadmin Email address used as the login username for the pgAdmin web interface.
PGADMIN_DEFAULT_PASSWORD pgadmin Password for accessing the pgAdmin web interface. Should be changed from default for security.

PS: Let's Encrypt only work in servers when the VIRTUAL_HOST and LETSENCRYPT_HOST have a valid public domain registered in a DNS server. Don't try to use in localhost, don't work!

Create a network

docker network create reverse-proxy
docker network create postgres

Run postgres and pgadmin

  • Crie uma pasta para o postgres e acesse ela depois:
    mkdir -p ~/projects/postgres
  • Crie o arquivo ~/projects/postgres/compose.yml com o conteúdo do arquivo compose.yml:
  • Levante os serviços:
docker compose up -d

Logs

If you want to see the logs, run:

docker compose logs -f --tail=100