Skip to content

Instantly share code, notes, and snippets.

@plmercereau
Last active August 2, 2020 18:55
Show Gist options
  • Save plmercereau/b8503c869ffa2b5d4e42dc9137b56ae1 to your computer and use it in GitHub Desktop.
Save plmercereau/b8503c869ffa2b5d4e42dc9137b56ae1 to your computer and use it in GitHub Desktop.
version: '3.1'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
postgres:
image: mdillon/postgis:11-alpine
restart: always
volumes:
- db_data:/var/lib/postgresql/data
authentication:
image: platyplus/authentication
restart: always
labels:
- "traefik.frontend.rule=Host:auth.${DOMAIN}"
- "traefik.port=8080"
depends_on:
- "postgres"
environment:
NODE_ENV: production
DATABASE_URL: postgres://postgres:@postgres:5432/postgres
AUTH_PRIVATE_KEY: "${PRIVATE_KEY}"
AUTH_PUBLIC_KEY: "${PUBLIC_KEY}"
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha37
labels:
- "traefik.frontend.rule=Host:graphql.${DOMAIN}"
- "traefik.port=8080"
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: "${HASURA_ENABLE_CONSOLE}"
HASURA_GRAPHQL_JWT_SECRET: '{"type":"RS256", "key":"${PUBLIC_KEY}"}'
HASURA_GRAPHQL_ACCESS_KEY: "${HASURA_ACCESS_KEY}"
volumes:
db_data:
@plmercereau
Copy link
Author

plmercereau commented May 17, 2019

I think Hasura requires to escape the end of lines in the key variables with "\n" instead. I am not sure this is the issue but I would give it a try. I explain it in this repo. What I did to format the key in the right format:

awk -v ORS='\\n' '1' public_key.pem

@celvin
Copy link

celvin commented May 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment