Skip to content
Open
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ npm run build

Learn more from the Create React App [README](https://github.com/facebook/create-react-app#npm-run-build-or-yarn-build) and [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment).

## Docker ##
To run this on a system without `make` and `node` you can use Docker.
The provided `docker-compose.yml` file builds a Docker image from the latest master commit of the current repository, starts the server and exposes port 3000.

To use it:

```
git clone --depth 1 https://github.com/magjac/graphviz-visual-editor
cd graphviz-visual-editor
docker-compose up -d
```
## Implemented Features ##

* Rendering of a graph from a textual [DOT](https://www.graphviz.org/doc/info/lang.html) representation.
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"
services:
graphviz-editor:
build:
context: ./docker
dockerfile: Dockerfile
container_name: graphviz-editor
ports:
- "3000:3000"
restart: always
33 changes: 33 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Multi-stage build to reduce final image size
FROM node:lts-alpine3.15 as BUILD_IMAGE

# Install git and make
RUN apk update
RUN apk add git
RUN apk add make

# Clone graphviz visual editor
RUN git clone --depth 1 https://github.com/magjac/graphviz-visual-editor

WORKDIR /graphviz-visual-editor

# Install and make the dependencies
RUN npm install
RUN make
RUN npm run build

# Reduce the image size: remove development dependencies
RUN npm prune --production

# The stage that actually runs the application
FROM node:lts-alpine3.15

WORKDIR /graphviz-visual-editor

# Copy the built artifacts from the build image
COPY --from=BUILD_IMAGE /graphviz-visual-editor/build ./build
COPY --from=BUILD_IMAGE /graphviz-visual-editor/node_modules ./node_modules

RUN npm install -g serve

CMD ["serve", "-s", "build"]