Add Hasura and dockerify dev env
This commit is contained in:
33
infra/dev/docker-compose.yml
Normal file
33
infra/dev/docker-compose.yml
Normal file
@ -0,0 +1,33 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
twenty-server:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: ./infra/dev/twenty-server/Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- postgres
|
||||
twenty-api:
|
||||
image: hasura/graphql-engine:latest
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- "postgres"
|
||||
restart: always
|
||||
environment:
|
||||
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/hasura
|
||||
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
|
||||
postgres:
|
||||
build: ./postgres
|
||||
volumes:
|
||||
- db_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_PASSWORD: postgrespassword
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
db_data:
|
||||
3
infra/dev/postgres/Dockerfile
Normal file
3
infra/dev/postgres/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM postgres:13.7 as postgres
|
||||
|
||||
COPY init.sql /docker-entrypoint-initdb.d/
|
||||
2
infra/dev/postgres/init.sql
Normal file
2
infra/dev/postgres/init.sql
Normal file
@ -0,0 +1,2 @@
|
||||
CREATE DATABASE twenty;
|
||||
CREATE DATABASE hasura;
|
||||
14
infra/dev/twenty-server/Dockerfile
Normal file
14
infra/dev/twenty-server/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM node:18-alpine as app
|
||||
|
||||
WORKDIR /app
|
||||
COPY ../.. .
|
||||
|
||||
WORKDIR /app/front
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
WORKDIR /app/server
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
14
infra/prod/Dockerfile
Normal file
14
infra/prod/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM node:18-alpine as app
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
WORKDIR /app/front
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
WORKDIR /app/server
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
Reference in New Issue
Block a user