This starter is useful for development purposes and faster environment setup.
It deploys PostgreSQL and Redis containers on a server and the containers are exposed to public. So you can share it among the teammates.
For the full explanation, check out the article.
- Create new droplet in DigitalOcean.
- Clone the repo:
> git clone https://github.com/kanzitelli/postgres-and-redis-behind-traefik.git backend
> cd backend
- Set up
.env
file:
> nano .env
Content of .env
file should look like this:
# Postgres
DB_NAME=db
DB_USER=admin
DB_PASS=pass_12345qwerty
- Build docker compose file
> sh build.sh
- Connect to PostgreSQL and Redis
Postgres:
Domain: postgresql://admin:pass@db.website.com:5432/db
IP: postgresql://admin:pass@46.101.120.53:5432/db
Redis:
Domain: redis://db.website.com:6379
IP: redis://46.101.120.53:6379