Use the public docker image nicolkill/dbb:latest and add the env vars listed bellow
docker-compose.yml exampleversion: '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
The schema config exists on his own file, but the server it's configured by env vars, so here the list
| Env var | Value | Default | Description |
|---|---|---|---|
| CONFIG_SCHEMA* | string | Your definition schema file name | |
| POSTGRES_USERNAME | string | postgres | PostgreSQL username |
| POSTGRES_PASSWORD | string | postgres | PostgreSQL password |
| POSTGRES_DATABASE | string | postgres | PostgreSQL database name |
| POSTGRES_HOSTNAME | string | postgres | PostgreSQL hostname, in docker-compose config must be the name of the container |
| Env var | Value | Default | Description |
|---|---|---|---|
| ALLOWED_SITES | string | http://localhost:4000 | Cors allowed sites |
| PHX_SERVER | boolean | Tells to Phoenix that must be a http-server, otherwise the server wouldn't serve the routes | |
| PHX_HOST | string | example.com | Domain name |
| Env var | Value | Default | Description |
|---|---|---|---|
| PORT | integer | 4000 | Port number, just for dev |
| ALLOWED_API_KEY | string | Static 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
Content type
Image
Digest
sha256:2d1698f85…
Size
103.9 MB
Last updated
almost 2 years ago
docker pull nicolkill/dbb