Skip to content

Commit

Permalink
work on dev backend
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Oct 1, 2023
1 parent 846decc commit aaba9f1
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
20 changes: 20 additions & 0 deletions backend-dev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local


# dotenv environment variables file
.env
.env*
dropbox_uploader.conf

35 changes: 35 additions & 0 deletions backend-dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.7'
services:
graphql:
container_name: apf_graphql
restart: unless-stopped
build:
context: ./graphql
expose:
- '5000'
ports:
- '5000:5000'
env_file:
- ./.env
command:
[
'--connection',
'${DATABASE_URL}',
'--schema',
'apflora',
'--append-plugins',
'postgraphile-plugin-connection-filter,@graphile-contrib/pg-order-by-related,@graphile/postgis,postgraphile-plugin-connection-filter-postgis',
'--jwt-token-identifier',
'auth.jwt_token',
'--default-role',
'postgres',
'--jwt-secret',
'${JWT_SECRET}',
'--body-size-limit',
'2MB',
'--cors',
'--disable-query-log',
'--enable-query-batching',
'--retry-on-init-fail',
'--enhance-graphiql',
]
9 changes: 9 additions & 0 deletions backend-dev/graphql/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.env
.git
.github
.vscode
node_modules
npm-debug.log

*Dockerfile*
*docker-compose*
8 changes: 8 additions & 0 deletions backend-dev/graphql/.postgraphilerc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
options: {
graphileBuildOptions: {
connectionFilterRelations: true,
orderByNullsLast: false,
},
},
}
15 changes: 15 additions & 0 deletions backend-dev/graphql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:slim

RUN npm install -g postgraphile
RUN npm install -g postgraphile-plugin-connection-filter
RUN npm install -g @graphile-contrib/pg-order-by-related
RUN npm install -g @graphile/postgis
RUN npm install -g postgraphile-plugin-connection-filter-postgis

COPY --chown=node:node .postgraphilerc.js .postgraphilerc.js

EXPOSE 5000

USER node

ENTRYPOINT ["postgraphile", "-n", "0.0.0.0"]

0 comments on commit aaba9f1

Please sign in to comment.