Skip to content
Closed
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
41 changes: 41 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Git files
.git
.gitignore
.gitattributes

# Documentation
README.md
*.md
docs/

# Development files
node_modules/
npm-debug.log
.npm

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Docker files
docker-compose.yml
Dockerfile
.dockerignore

# Build artifacts
dist/
build/
*.log

# Test files
test/
tests/
*.test.js
*.spec.js
57 changes: 50 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,58 @@
# WebVOWL #
###########

# Use tomcat java 8 alpine as base image
FROM tomcat:9-jre8-alpine
# Build stage: Build WebVOWL from source since WAR downloads are no longer available
FROM docker.io/library/node:18-alpine AS builder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newer node versions probably not work because of the old project?


# Build time arguments (WebVOWL version)
ARG version=1.1.7
# Build time arguments (WebVOWL version tag/branch)
ARG VERSION=master

# Download WebVOWL to tomcat webapps directory as root app
RUN rm -rf /usr/local/tomcat/webapps/* && \
wget -O /usr/local/tomcat/webapps/ROOT.war http://vowl.visualdataweb.org/downloads/webvowl_1.1.7.war
# Install build dependencies
RUN apk add --no-cache git

# Clone WebVOWL repository
WORKDIR /build
RUN git clone --depth 1 --branch ${VERSION} https://github.com/VisualDataWeb/WebVOWL.git . || \
git clone --depth 1 https://github.com/VisualDataWeb/WebVOWL.git .

# Install dependencies and build
RUN npm install && \
npm run release

# Runtime stage: Tomcat server
# Option 1: Use JRE 8 Alpine (smaller but older Java - ~100MB)
# FROM docker.io/library/tomcat:9-jre8-alpine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tested commented options are not necessary


# Option 2: Use JRE 17 LTS on Temurin (recommended, modern Java - ~250MB)
FROM docker.io/library/tomcat:9-jre17-temurin-noble

# Option 3: Use JRE 21 LTS on Temurin (latest LTS - ~250MB)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not this?

# FROM docker.io/library/tomcat:9-jre21-temurin-noble

# Re-declare ARG for this stage
ARG VERSION=master

# Add metadata labels
LABEL maintainer="WebVOWL"
LABEL description="WebVOWL - Web-based Visualization of Ontologies"
LABEL version="${VERSION}"

# Set working directory
WORKDIR /usr/local/tomcat

# Copy built files from builder stage
RUN rm -rf webapps/*
COPY --from=builder /build/deploy/ webapps/ROOT/

# Expose tomcat default port
EXPOSE 8080

# Add healthcheck (using curl which is available in Temurin images)
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1

# Run as non-root user for security
USER nobody

# Run default server
CMD ["catalina.sh", "run"]
56 changes: 56 additions & 0 deletions Dockerfile.combined
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#####################
# WebVOWL Combined #
#####################
# This Dockerfile builds both WebVOWL and OWL2VOWL into a single image with nginx

# Stage 1: Build WebVOWL
FROM docker.io/library/node:18-alpine AS webvowl-builder
ARG WEBVOWL_VERSION=master
RUN apk add --no-cache git
WORKDIR /build/webvowl
RUN git clone --depth 1 --branch ${WEBVOWL_VERSION} https://github.com/VisualDataWeb/WebVOWL.git . || \
git clone --depth 1 https://github.com/VisualDataWeb/WebVOWL.git .
RUN npm install && npm run release

# Stage 2: Build OWL2VOWL
FROM docker.io/library/maven:3.9-eclipse-temurin-11 AS owl2vowl-builder
ARG OWL2VOWL_VERSION=master
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /build/owl2vowl
RUN git clone --depth 1 --branch ${OWL2VOWL_VERSION} https://github.com/VisualDataWeb/OWL2VOWL.git . || \
git clone --depth 1 https://github.com/VisualDataWeb/OWL2VOWL.git .
RUN mvn clean package -P war-release -DskipTests

# Stage 3: Runtime with Tomcat and Nginx
FROM docker.io/library/tomcat:9-jre11-temurin-noble

# Install nginx and supervisor
RUN apt-get update && \
apt-get install -y nginx supervisor && \
rm -rf /var/lib/apt/lists/*

# Copy WebVOWL files
RUN rm -rf /usr/local/tomcat/webapps/*
COPY --from=webvowl-builder /build/webvowl/deploy/ /var/www/webvowl/

# Copy OWL2VOWL WAR
COPY --from=owl2vowl-builder /build/owl2vowl/target/*.war /usr/local/tomcat/webapps/ROOT.war

# Copy nginx configuration
RUN mkdir -p /etc/nginx/sites-enabled /etc/nginx/sites-available
COPY nginx-combined.conf /etc/nginx/sites-available/webvowl
RUN ln -s /etc/nginx/sites-available/webvowl /etc/nginx/sites-enabled/ && \
rm -f /etc/nginx/sites-enabled/default

# Copy supervisor configuration
COPY supervisord.conf /etc/supervisor/conf.d/services.conf

# Expose port 80
EXPOSE 80

# Add metadata
LABEL maintainer="WebVOWL Combined"
LABEL description="WebVOWL with integrated OWL2VOWL converter"

# Run supervisor to manage both services
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
53 changes: 53 additions & 0 deletions Dockerfile.owl2vowl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
###############
# OWL2VOWL #
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what purpose do you see in keeping both variants? combined vs single one images?
If splitted owl2vowl has to be in its one repository

###############

# Build stage: Build OWL2VOWL from source
# Using Java 11 as OWL2VOWL has compatibility issues with Java 17+
FROM docker.io/library/maven:3.9-eclipse-temurin-11 AS builder

# Build time arguments
ARG VERSION=master

# Install git
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Clone OWL2VOWL repository
WORKDIR /build
RUN git clone --depth 1 --branch ${VERSION} https://github.com/VisualDataWeb/OWL2VOWL.git . || \
git clone --depth 1 https://github.com/VisualDataWeb/OWL2VOWL.git .

# Build the WAR file
RUN mvn clean package -P war-release -DskipTests

# Runtime stage: Tomcat server
# Using Java 11 runtime for compatibility
FROM docker.io/library/tomcat:9-jre11-temurin-noble

# Re-declare ARG for this stage
ARG VERSION=master

# Add metadata labels
LABEL maintainer="OWL2VOWL"
LABEL description="OWL2VOWL - Converting ontologies for WebVOWL"
LABEL version="${VERSION}"

# Set working directory
WORKDIR /usr/local/tomcat

# Copy built WAR file from builder stage
RUN rm -rf webapps/*
COPY --from=builder /build/target/*.war webapps/ROOT.war

# Expose tomcat default port
EXPOSE 8080

# Add healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1

# Run as non-root user for security
USER nobody

# Run default server
CMD ["catalina.sh", "run"]
Loading