Skip to content

Commit

Permalink
Add frank-flow to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsens committed Sep 18, 2024
1 parent 34c3a2a commit ecd33f1
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 92 deletions.
41 changes: 10 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,25 @@
ARG FF_VERSION=latest

FROM frankframework/frankframework:${FF_VERSION} as ff-base
FROM maven as maven-build

## Uncomment this section if the Frank! contains custom classes.
# Copy dependencies
COPY --chown=tomcat lib/server/ /usr/local/tomcat/lib/
COPY --chown=tomcat lib/webapp/ /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/
COPY pom.xml .

# Compile custom class
FROM eclipse-temurin:17-jdk-jammy AS custom-code-builder
RUN mvn install

# # Uncomment this section if the Frank! contains custom classes.
# # Copy dependencies
# COPY --from=ff-base /usr/local/tomcat/lib/ /usr/local/tomcat/lib/
# COPY --from=ff-base /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/ROOT
FROM frankframework/frankframework:${FF_VERSION}

# # Copy custom class
# COPY src/main/java /tmp/java
# RUN mkdir /tmp/classes && \
# javac \
# /tmp/java/org/<path-to-customcode-file>.java \
# -classpath "/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/*:/usr/local/tomcat/lib/*" \
# -verbose -d /tmp/classes
COPY --from=maven-build target/frank-flow*.war /usr/local/tomcat/webapps/frank-flow.war

FROM ff-base
# Copy dependencies
COPY --chown=tomcat lib/server/ /usr/local/tomcat/lib/
COPY --chown=tomcat lib/webapp/ /usr/local/tomcat/webapps/ROOT/WEB-INF/lib/

# Copy database connection settings
COPY --chown=tomcat src/main/webapp/META-INF/context.xml /usr/local/tomcat/conf/Catalina/localhost/ROOT.xml

# Copy Frank!
COPY --chown=tomcat src/main/configurations/ /opt/frank/configurations/
COPY --chown=tomcat src/main/resources/ /opt/frank/resources/
COPY --chown=tomcat src/test/testtool/ /opt/frank/testtool/

# # Uncomment this section if the Frank! contains custom classes.
# # Copy compiled custom classes
# COPY --from=custom-code-builder --chown=tomcat /tmp/classes/ /usr/local/tomcat/webapps/ROOT/WEB-INF/classes

# COPY --chown=tomcat entrypoint.sh /scripts/entrypoint.sh
COPY --chown=tomcat src/main/ /opt/frank/
COPY --chown=tomcat src/test/ /opt/frank/

HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=60 \
CMD curl --fail --silent http://localhost:8080/iaf/api/server/health || (curl --silent http://localhost:8080/iaf/api/server/health && exit 1)

# ENTRYPOINT ["/scripts/entrypoint.sh"]
# CMD ["catalina.sh", "run"]
66 changes: 7 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,11 @@
# Demo
# Frank!Framework Demo

Project for Frank applications deployed by JAR or Docker
A demo application for the [Frank!Framework](https://github.com/frankframework/frankframework).

<!-- TOC -->
* [Skeleton Project for Frank applications deployed by JAR or Docker](#skeleton-project-for-frank-applications-deployed-by-jar-or-docker)
* [Introduction](#introduction)
* [Included](#included)
* [Usage](#usage)
* [Steps](#steps)
* [Template variables](#template-variables)
<!-- TOC -->
The demo contains the following features:

## Introduction
* Ladybug
* Frank!Flow
* Demonstrative configurations

This project serves as a starting point for new projects or as example for existing ones.
This "empty" Frank! will have configuration files to build and deploy.

## Included

* Dockerfile
* Docker compose
* Publicode (WIP)
* GitHub Actions
* Continuous Integration workflow
* Release workflow

Please check if you deem all these functionalities necessary, if not remove them.

## Usage

### Steps

1. Create a new repository and choose this as template repository
2. Clone the newly created project
3. Fill in the skeletonrc.json to replace the template strings
4. Run the skeleton.js script with node e.g. `node ./skeleton.js`
5. Add your own configuration files
6. Make sure that the GitHub action credentials are added
7. Commit & Profit!

### Configure Docusaurus GitHub Pages deployment
1. Navigate to `GitHub -> Repository -> Pages -> Build and deployment` and select `GitHub Actions` from the **source** dropdown.
2. Navigate to `GitHub -> Repository -> Environments` and create a **New Environment** called `github-pages` if it does not exist yet.
3. Enable the "docusaurus-release" job in `.github/workflows/release.yml` by setting "if" to `true`.

## Local Development Docusaurus
1. Navigate to "docusaurus" subfolder with `cd ./docusaurus`.
2. Install dependencies with `npm install`.
3. Serve Docusaurus webserver locally with `docusaurus start`. By default it is served at `http://localhost:3000/`.
4. Basic guide on how to use Docusaurus and a styleguide can be found at `./docusaurus/docs/_README.md`.

#### Update Docusaurus dependencies
1. Navigate to "docusaurus" subfolder with `cd ./docusaurus`.
2. Update dependencies with `npm i @docusaurus/core@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@latest @docusaurus/tsconfig@latest @docusaurus/types@latest`

## Template variables

| Template variable | Description | Example |
|-------------------------------|------------------------------------------------------------------------------------------------|----------------|
| `Demo` | The name of the Frank! to be deployed. It's best to keep this inline with the name of the repo | Frank2Skeleton |
| `demo` | Lowercase version of the instance name. | frank2example |
| `main` | The name of the first configuration (others have to be added manually) | Sans |
The demonstration is available at [demo.wearefrank.org](https://demo.wearefrank.org).
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:
frank:
build: .
image: wearefrank/demo:${VERSION:-latest}
image: ghcr.io/wearefrank/demo:${VERSION:-latest}
ports:
- "${PORT:-8080}:8080"
environment:
Expand Down
52 changes: 51 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
<!-- This empty pom is to tell the Frank!Runner this project uses the Maven structure -->
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.wearefrank.frankframework.demo</groupId>
<artifactId>frankframework-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<repositories>
<repository>
<id>frankframework</id>
<url>https://nexus.frankframework.org/content/groups/public</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.frankframework</groupId>
<artifactId>frank-flow</artifactId>
<version>[3,)</version>
<type>war</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit ecd33f1

Please sign in to comment.