Sign inSign up

nicolkill/dbb

By nicolkill

•Updated almost 2 years ago

Image
0

620

nicolkill/dbb repository overview

⁠How to run:

⁠Using docker image

Use the public docker image nicolkill/dbb:latest and add the env vars listed bellow

⁠docker-compose.yml example
version: '3.4'
services:
  prod:
    image: nicolkill/dbb:latest
    depends_on:
      - postgres
    ports:
      - 4001:443
    volumes:
      - ./prod_test.json:/app/prod_test.json    # important add the volume
    environment:
      PORT: 443
      ALLOWED_SITES: "*"
      CONFIG_SCHEMA: prod_test.json             # must match with volume
      PHX_SERVER: true
      SECRET_KEY_BASE: example_SECRET_KEY_BASE

      # db config
      POSTGRES_USERNAME: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DATABASE: dbb_test_prod
      POSTGRES_HOSTNAME: postgres

  postgres:
    image: postgres:13.3-alpine
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_HOST_AUTH_METHOD: trust
    ports:
      - 5432:5432

IMPORTANT! You need already created your database in the db server, migrations must be run once the server starts

⁠Configure

The schema config exists on his own file, but the server it's configured by env vars, so here the list

⁠Mandatory
Env varValueDefaultDescription
CONFIG_SCHEMA*stringYour definition schema file name
POSTGRES_USERNAMEstringpostgresPostgreSQL username
POSTGRES_PASSWORDstringpostgresPostgreSQL password
POSTGRES_DATABASEstringpostgresPostgreSQL database name
POSTGRES_HOSTNAMEstringpostgresPostgreSQL hostname, in docker-compose config must be the name of the container
⁠Mandatory on prod
Env varValueDefaultDescription
ALLOWED_SITESstringhttp://localhost:4000⁠Cors allowed sites
PHX_SERVERbooleanTells to Phoenix that must be a http-server, otherwise the server wouldn't serve the routes
PHX_HOSTstringexample.comDomain name
⁠Optional
Env varValueDefaultDescription
PORTinteger4000Port number, just for dev
ALLOWED_API_KEYstringStatic API Key to secure calls on API CRUD

In case that prod deployment, the port it's 443 (https) and the port it's for standart calls, but this will be redirected

Tag summary

Content type

Image

Digest

sha256:2d1698f85…

Size

103.9 MB

Last updated

almost 2 years ago

docker pull nicolkill/dbb