Skip to content

Commit

Permalink
🐳 Adds Docker Container Configuration (#265)
Browse files Browse the repository at this point in the history
This PR adds a docker configuration for the DDVis project. Our webserver
app has been broken one too many times by now. This creates an isolated
container that we can also test during CI. This should simplify our
lives considerably.
  • Loading branch information
burgholzer authored Jun 3, 2024
1 parent d33be51 commit a5336b0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ jobs:
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- run: pipx install ninja
- run: npm ci
- run: npm run build --if-present
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.19...3.28)

# detailed description
project(
DDVis
VERSION 1.5.1
mqt-ddvis
VERSION 1.7.0
DESCRIPTION "MQT DDVis - A Tool for Visualizing Decision Diagrams for Quantum Computing"
LANGUAGES CXX)

Expand Down
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use an official Node.js runtime as the base image
FROM node:20-alpine

# Add gcc and cmake
RUN apk add build-base cmake ninja

# Set the working directory in the container to /app
WORKDIR /app

# Copy package.json and package-lock.json into the directory /app in the container
COPY package*.json ./

# Install any needed packages specified in package.json
RUN npm install

# Copy the rest of the application code into the container
COPY . .

# Install the project
RUN npm run build

# Make port 3000 available to the outside world
EXPOSE 3000

# Define the command to run the application
CMD [ "npm", "run", "run" ]
2 changes: 1 addition & 1 deletion datamanager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const qddVis = require("./build/Release/DDVis");
const qddVis = require("./build/Release/mqt-ddvis");

//const data = new Map(); //saves the QDDVis-objects needed for simulation

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "ddvis",
"version": "1.6.1",
"name": "mqt-ddvis",
"version": "1.7.0",
"description": "MQT DDVis - A Tool for Visualizing Decision Diagrams for Quantum Computing",
"main": "server.js",
"scripts": {
"build": "cmake-js compile --config Release --CDCMAKE_BUILD_PARALLEL_LEVEL=4",
"prerun": "npm run build",
"build": "cmake-js compile --config Release -G Ninja --target mqt-ddvis",
"run": "node ./bin/www"
},
"repository": {
Expand Down

0 comments on commit a5336b0

Please sign in to comment.