padloc/docs/examples/hosting/docker/postgres-nginx-letsencrypt/README.md

1.3 KiB

Docker + Postgres + NGINX + Letsencrypt

This is a more advanced example of running an instance of the Padloc server component and web app with Docker and Docker Compose, using:

Setup Instructions

  1. Install Docker and Docker Compose

  2. Clone or download this folder and cd into it.

  3. Edit the .env file to set your STMP settings, Postgres database name, username and password, and the host name / domain you want to host the web app and server under.

  4. Obtain an TLS certificate

    docker-compose up cerbot
    
  5. Start the server, pwa, database and reverse proxy:

    docker-compose up -d
    

Thats it! The web app is now available at https://$PL_HOSTNAME

Renewing the TLS certificate

TLS certificates issued by Letsencrypt are usually valid for 90 days, so you'll have to regularly renew your certificate. To do so, simply run the following:

docker-compose down && \
docker-compose up certbot && \
docker-compose up -d