Code Monkey home page Code Monkey logo

postgres-traefik-keycloak-docker's Introduction

Deploy Traefik, Portainer, Postgres & pgadmin with Docker using LetsEncrypt to manage certificates.

In this guide we will

  • deploy Traefik as a reverse proxy for Docker
  • deploy Postgres & pgadmin for Docker
  • deploy portainer for Docker (manage containers in Docker)
  • run all containers on a Linux Ubuntu 20.xx
  • use LetsEncrypt for certification

Required:

You have 3 domain names configured, e.g:

  • traefik.domain-name.com
  • pgadmin.domain-name.com
  • portainer.domain-name.com

Quick Install

1. Connect to your server and clone the repo

git clone https://gitlab.com/ArnaudSene/postgres-traefik-docker.git
cd postgres-traefik-docker

2. Postgres & pgadmin configuration

go to ./postgres-traefik-docker/apps/postgres

cp env-custom .env
vi .env

Replace values between <> with your data.

POSTGRES_USER=postgres
POSTGRES_PASSWORD=<password>
POSTGRES_DB=<db_name>
PGADMIN_DEFAULT_EMAIL=<email>
PGADMIN_DEFAULT_PASSWORD=<pg_password>
PGADMIN_HOST=pgadmin.<domain_name>

3. Traefik configuration

go to ./postgres-traefik-docker/traefik

cp env-custom .env
vi .env

Replace values between <> with your data.

CERT_EMAIL=<email@domain_name>
TRAEFIK_HOST=traefik.<domain_name>
PORTAINER_HOST=portainer.<domain_name>

4. Create an encrypted password (Traefik dashboard)

go to ./postgres-traefik-docker/traefik

  • Install htpasswd tool
sudo apt-get update
sudo apt-get install apache2-utils
  • Save the encrypted password into traefik/users_file (htpasswd)
htpasswd -nb admin your_password > users_file
  • set 600 permission on file traefik/users_file
sudo chmod 600 users_file

5. set 600 permission on file traefik/data/acme.json

go to ./postgres-traefik-docker/traefik/data

sudo chmod 600 acme.json

6. Start containers

Start Traefik reverse proxy

go to ./postgres-traefik-docker/traefik

chmod u+x start.sh
chmod u+x stop.sh
./start.sh

Start Postgres & pgadmin

go to ./postgres-traefik-docker/apps/postgres

chmod u+x start.sh
chmod u+x stop.sh
./start.sh

7. Stop containers

Stop Traefik reverse proxy

go to ./postgres-traefik-docker/traefik

./stop.sh

Start Postgres & pgadmin

go to ./postgres-traefik-docker/apps/postgres

./stop.sh

Access web apps

1. Traefik dashboard

Protected with basicAuth. Use your encrypted password to log in.

https://traefik.your-domain-name.com

2. Portainer apps

Create a user and password first then log in.

https://portainer.your-domain-name.com

3. pgadmin portal

Credentials defined in .env file

https://pgadmin.your-domain-name.com

postgres-traefik-keycloak-docker's People

Contributors

arnaudsene avatar

Watchers

 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.