Skip to content

Commit

Permalink
Add docker-compose configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
blenderskool committed Nov 23, 2021
1 parent 90377a8 commit e0d8c69
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Third party APIs make it easy to integrate functionalities across apps. But using them on a purely front-end project is a hassle. Most of the time, the API endpoints require an API key which cannot be exposed on the frontend. Hence, most of us setup a proxy backend server that makes the request to the third party API with the API keys and make the frontend request this proxy server instead. While it might be a trivial solution that shouldn't take a lot of time to implement, it can get very repeatable and tedious over time.

**Diode solves this** problem by abstracting this proxy server and allowing you to add and configure as many API routes and consume them directly on the frontend **without having to worry about exposing any API keys**! Since Diode sits in between all the requests going to the third-party server, it also makes it easy to add **commonly used middlewares to the API route** with just a click!
_Fun fact: All of this happens without you have to write a single line of code._
_Fun fact: All of this happens without you having to write a single line of code._

### Features
- 💡 Easy to use dashboard.
Expand All @@ -28,10 +28,10 @@ _Fun fact: All of this happens without you have to write a single line of code._

### Try it out
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/blenderskool/diode)
[![Try in Play-With-Docker](./public/try-with-docker.svg)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/blenderskool/diode/docker-compose.yml)

_Note: Deploying on Heroku free plan may cause higher latencies_


## Project Setup
### Pre-requisites:
- Node.js and npm installed.
Expand Down
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'
services:
postgres:
image: "postgres:alpine"
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: diodeDb

redis:
image: "redis:alpine"

diode:
image: "akashhamirwasia/diode:latest"
ports:
- 80:3000
depends_on:
- postgres
- redis
links:
- postgres
- redis
environment:
DATABASE_URL: postgresql://root:root@postgres:5432/diodeDb?schema=public
REDIS_URL: redis://redis:6379
# Example values for encryption keys.
# Generating new keys is recommended for production use.
SECRETS_KEY: 7387037c9716a739ae6a80232cfce456
SECRETS_IV: 979f27a599b31ab7
6 changes: 6 additions & 0 deletions public/try-with-docker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e0d8c69

Please sign in to comment.