Skip to content

Commit

Permalink
fix: fixes Heroku deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshnirmalya committed Jul 29, 2020
1 parent b8615d0 commit 0dcbbd3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
5 changes: 0 additions & 5 deletions backend/.env.example

This file was deleted.

25 changes: 19 additions & 6 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM hasura/graphql-engine:v1.3.0-beta.4.cli-migrations-v2

# Set working directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# # Copy migrations directory
COPY ./migrations /hasura-migrations

COPY . /usr/src/app
# # Copy metadata directory
COPY ./metadata /hasura-metadata

# Enable the console
ENV HASURA_GRAPHQL_ENABLE_CONSOLE=true

# Heroku hobby tier PG has few limitations including 20 max connections
# https://devcenter.heroku.com/articles/heroku-postgres-plans#hobby-tier
ENV HASURA_GRAPHQL_PG_CONNECTIONS=15

# https://github.com/hasura/graphql-engine/issues/4651#issuecomment-623414531
ENV HASURA_GRAPHQL_CLI_ENVIRONMENT=default

# https://github.com/hasura/graphql-engine/issues/5172#issuecomment-653774367
ENV HASURA_GRAPHQL_MIGRATIONS_DATABASE_ENV_VAR=DATABASE_URL

CMD graphql-engine \
--database-url $HASURA_GRAPHQL_DATABASE_URL \
--database-url $DATABASE_URL \
serve \
--enable-console
--server-port $PORT
6 changes: 3 additions & 3 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ services:
context: .
depends_on:
- db
env_file: ./.env
environment:
DATABASE_URL: postgres://postgres:@db:5432/postgres
PORT: 8080
ports:
- "8080:8080"
volumes:
- .:/usr/src/app
restart: on-failure

db:
Expand Down

1 comment on commit 0dcbbd3

@vercel
Copy link

@vercel vercel bot commented on 0dcbbd3 Jul 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.