FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow running via docker-compose by nightscape · Pull Request #268 · unigraph-dev/unigraph-dev · GitHub

Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (2) .yml  (1) No extension  (1) dotfile  (1) All 4 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions .dockerignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.dockerignore
Dockerfile
.git
.gitignore
.gitmodules
docker-compose.yml
secrets.env.json
10 changes: 10 additions & 0 deletions Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:15
WORKDIR /app
RUN apt update && apt install -y netcat
ADD --chmod=755 https://raw.githubusercontent.com/eficode/wait-for/v2.2.1/wait-for /app/wait-for
ADD package.json yarn.lock /app/
RUN yarn install
ADD . /app
RUN yarn && yarn build-deps
RUN chmod 0755 /app/wait-for
CMD ["yarn", "backend-start"]
41 changes: 41 additions & 0 deletions docker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.3'
services:
backend:
build: .
command: /app/wait-for dgraph-alpha:9080 -- yarn backend-start dgraph-alpha:9080
volumes:
- ./secrets.env.json:/app/secrets.env.json
depends_on:
- dgraph-zero
- dgraph-alpha
ports:
- 3001:3001
frontend:
build: .
entrypoint: yarn explorer-start
depends_on:
- backend
ports:
- 3000:3000
dgraph-zero:
ports:
- '5080:5080'
- '6080:6080'
restart: unless-stopped
image: ebdm/unigraph-dgraph
command: dgraph zero --my=dgraph-zero:5080
dgraph-alpha:
ports:
- '9080:9080'
- '8080:8080'
restart: unless-stopped
image: ebdm/unigraph-dgraph
command: dgraph alpha --my=dgraph-alpha:7080 --zero=dgraph-zero:5080 --whitelist="172.22.0.0/24"
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.22.0.0/24"
gateway: "172.22.0.1"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class DgraphClient {
constructor(connectionUri: string) {
this.dgraphClientStub = new DgraphClientStub(connectionUri, undefined, {'grpc.max_receive_message_length': 1024 * 1024 * 1024});
this.dgraphClientStub.checkVersion(new Check()).catch(e => {if (e.code === 14) {
throw new Error("Could not establish connection to Dgraph client, exiting...");
throw new Error(`Could not establish connection to Dgraph client at ${connectionUri}, exiting...`);
}})
this.dgraphClient = new ActualDgraphClient(this.dgraphClientStub);
this.txnlock = getAsyncLock();
Expand Down
4 changes: 3 additions & 1 deletion packages/unigraph-dev-backend/src/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import Client from './dgraphClient';
import startServer from './server';

async function main() {
const client = new Client('localhost:9080');
const args = process.argv.slice(2);
const dgraphAddress = args[0] || 'localhost:9080';
const client = new Client(dgraphAddress);
const [app, server] = await startServer(client);

server.on('close', () => (console.log('CLOSING'), client.close()));
Expand Down

Back | FazBrowse Home | New Git URL