Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.git
# System files
.DS_Store

# Logs
*.log
npm-debug.log*

# Directories
node_modules
*/node_modules
packages/*/dist
.ignore
coverage/
.history

# Secrets
secrets.env.json

# Etc
packages/unigraph-dev-backend/exports.json

# Obsidian for docs
docs/.obsidian/workspace
docs/.obsidian/plugins

# Linting
.eslintcache
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# syntax=docker/dockerfile:1
FROM amd64/ubuntu:20.04

# Set up dependencies
RUN apt update && apt install -y curl wget

# Set up Node.js 16
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
RUN bash /tmp/nodesource_setup.sh
RUN apt update && apt install -y nodejs
RUN npm install yarn -g

# Set up dgraph
ADD https://github.com/unigraph-dev/dgraph/releases/latest/download/dgraph_linux_amd64 dgraph_linux_amd64
RUN mkdir /opt/unigraph
RUN mv dgraph_linux_amd64 /opt/dgraph
RUN chmod +x /opt/dgraph

# Set up unigraph, with incremental caches
COPY package.json yarn.lock /app/
COPY ./packages/unigraph-dev-backend/package.json /app/packages/unigraph-dev-backend/package.json
COPY ./packages/unigraph-dev-common/package.json /app/packages/unigraph-dev-common/package.json
COPY ./packages/unigraph-dev-electron/package.json /app/packages/unigraph-dev-electron/package.json
COPY ./packages/unigraph-dev-explorer/package.json /app/packages/unigraph-dev-explorer/package.json
RUN cd /app && yarn --network-timeout 600000
COPY . /app
RUN cd /app && yarn --network-timeout 600000
RUN cd /app && yarn build-deps

# Run Unigraph
WORKDIR /app
CMD ["sh", "-c", "./scripts/start_server.sh -b /opt/dgraph -d /opt/unigraph & yarn explorer-start"]

EXPOSE 3000
EXPOSE 4001
EXPOSE 4002
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ License:

## Getting started

### Running with Docker image

We provide an experimental Dockerfile for easy setup:

- Building Unigraph: `docker build -t unigraph-devserver .` (this should take roughly 10 minutes max),
- Running Unigraph: `docker run -d -p 4002:4002 -v <data directory>:/opt/unigraph -p 4001:4001 -p 3000:3000 -P unigraph-devserver`,

To update the Docker image, run `docker build` again after `git pull`.

### Building from source

**1)** Build the [`Dgraph`](https://github.com/unigraph-dev/dgraph) backend binary from source [[reference](https://github.com/unigraph-dev/dgraph#install-from-source)]

> requires `gcc`, `make`, `go>=1.13`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"postinstall": "run-script-os",
"postinstall:linux:darwin": "(mkdir packages/unigraph-dev-explorer/public/vendor/ || true) && cp -R ./node_modules/monaco-editor/min/vs packages/unigraph-dev-explorer/public/vendor/monaco-editor_at_0.31.1/",
"postinstall:linux:darwin": "(mkdir packages/unigraph-dev-explorer/public/vendor/ || true) && (cp -R ./node_modules/monaco-editor/min/vs packages/unigraph-dev-explorer/public/vendor/monaco-editor_at_0.31.1/ || true)",
"postinstall:windows": "pwsh -Command \"mkdir -Force packages/unigraph-dev-explorer/public/vendor/ && Copy-Item ./node_modules/monaco-editor/min/vs -Destination packages/unigraph-dev-explorer/public/vendor/monaco-editor_at_0.31.1/ -Recurse -Force\"",
"backend-build": "yarn workspace unigraph-dev-backend build",
"backend-start": "yarn workspace unigraph-dev-backend start",
Expand Down
9 changes: 0 additions & 9 deletions packages/unigraph-dev-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"@date-io/moment": "1.x",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@material-ui/core": "^4.11.0",
"@material-ui/data-grid": "^4.0.0-alpha.25",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.57",
"@material-ui/pickers": "^3.3.10",
"@mdi/js": "^6.4.95",
"@mdi/react": "^1.5.0",
"@monaco-editor/react": "^4.1.3",
Expand Down Expand Up @@ -47,7 +42,6 @@
"jquery": "^3.5.1",
"lodash": "^4.17.20",
"mdast-util-wiki-link": "^0.0.2",
"micromark-extension-wiki-link": "^0.0.4",
"mini-css-extract-plugin": "0.11.3",
"mixpanel-browser": "^2.42.0",
"moment": "^2.29.1",
Expand All @@ -73,7 +67,6 @@
"react-markdown": "^6.0.2",
"react-refresh": "^0.8.3",
"react-resize-detector": "^6.7.6",
"react-router-dom": "^5.2.0",
"react-splitter-layout": "^4.0.0",
"react-swipeable": "^6.1.2",
"react-transition-group": "^4.4.2",
Expand All @@ -97,7 +90,6 @@
"typescript": "^4.2.2",
"unigraph-dev-common": "^0.2.7",
"url-loader": "4.1.1",
"uuid": "^8.3.2",
"webpack": "4.44.2",
"webpack-dev-server": "3.11.1",
"webpack-manifest-plugin": "2.2.0",
Expand All @@ -114,7 +106,6 @@
"@types/react": "^17.0.1",
"@types/react-big-calendar": "^0.36.2",
"@types/react-dom": "^17.0.1",
"@types/react-router-dom": "^5.1.6",
"@types/turndown": "^5.0.1",
"@types/uuid": "^8.3.0",
"@welldone-software/why-did-you-render": "^6.2.3",
Expand Down
1 change: 0 additions & 1 deletion packages/unigraph-dev-explorer/src/react-app-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ declare module '*.pkg' {
}

declare module 'remark-wiki-link';
declare module 'micromark-extension-wiki-link';
1 change: 1 addition & 0 deletions scripts/start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi

par=$( cd $(dirname $0) ; pwd -P )

eval 'mkdir $data || true'
eval 'cd $data && $dgraph alpha &'
eval 'cd $data && $dgraph zero &'
sleep 10
Expand Down