Setup Hasura locally
This commit is contained in:
@ -1,17 +1,42 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
twenty:
|
||||
twenty-front:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: ./infra/dev/twenty/Dockerfile
|
||||
dockerfile: ./infra/dev/front/Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001"
|
||||
- "6006:6006"
|
||||
volumes:
|
||||
- ../..:/app
|
||||
- twenty_node_modules_root:/app/node_modules
|
||||
- ../../front:/app/front
|
||||
- twenty_node_modules_front:/app/front/node_modules
|
||||
depends_on:
|
||||
- postgres
|
||||
twenty-hasura:
|
||||
build: ./hasura
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "9695:9695"
|
||||
- "9693:9693"
|
||||
volumes:
|
||||
- ../../hasura:/hasura
|
||||
depends_on:
|
||||
- "postgres"
|
||||
restart: always
|
||||
environment:
|
||||
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/hasura
|
||||
HASURA_GRAPHQL_PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/twenty
|
||||
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
|
||||
HASURA_GRAPHQL_DEV_MODE: "true"
|
||||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
|
||||
twenty-server:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: ./infra/dev/server/Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ../../front:/app/front
|
||||
- twenty_node_modules_server:/app/server/node_modules
|
||||
depends_on:
|
||||
- postgres
|
||||
@ -25,6 +50,5 @@ services:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
db_data:
|
||||
twenty_node_modules_root:
|
||||
twenty_node_modules_front:
|
||||
twenty_node_modules_server:
|
||||
@ -1,12 +1,12 @@
|
||||
FROM node:18-alpine as app
|
||||
FROM node:18-alpine as front
|
||||
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache bash git openssh && \
|
||||
apk add libc6-compat
|
||||
|
||||
WORKDIR /app
|
||||
COPY ../.. .
|
||||
WORKDIR /app/front
|
||||
COPY ../../front .
|
||||
|
||||
RUN npm run install-dev
|
||||
RUN npm install
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
9
infra/dev/hasura/Dockerfile
Normal file
9
infra/dev/hasura/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM hasura/graphql-engine:latest as api
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y curl
|
||||
RUN apt-get install -y socat
|
||||
RUN apt-get install -y vim
|
||||
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
|
||||
|
||||
CMD ["sh", "-c", "graphql-engine serve"]
|
||||
@ -1 +1,2 @@
|
||||
CREATE DATABASE twenty;
|
||||
CREATE DATABASE twenty;
|
||||
CREATE DATABASE hasura;
|
||||
12
infra/dev/server/Dockerfile
Normal file
12
infra/dev/server/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM node:18-alpine as server
|
||||
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache bash git openssh && \
|
||||
apk add libc6-compat
|
||||
|
||||
WORKDIR /app/server
|
||||
COPY ../../server .
|
||||
|
||||
RUN npm install
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user