Skip to content

Added docker build and quick-start #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
62 changes: 62 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.DS_Store
**/.classpath
**/.dockerignore
**/.env
**/.factorypath
**/.git
**/.gitignore
**/.idea
**/.project
**/.sts4-cache
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/secrets.dev.yaml
**/values.dev.yaml
**/vendor
LICENSE
README.md
**/*.class
**/*.iml
**/*.ipr
**/*.iws
**/*.log
**/.apt_generated
**/.gradle
**/.gradletasknamecache
**/.nb-gradle
**/.springBeans
**/build
**/dist
**/gradle-app.setting
**/nbbuild
**/nbdist
**/nbproject/private
**/target
*.ctxt
.mtj.tmp
.mvn/timing.properties
buildNumber.properties
dependency-reduced-pom.xml
hs_err_pid*
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
release.properties
replay_pid*
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
33 changes: 33 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# For developers and contributors

## "Easy Path" with docker

```bash
# Build using docker
docker build -t oie-dev .
# Start an ephemeral image
# NOTE: All data will be deleted on stop due to --rm. Use a volume for "real" use.
docker run --rm -p 8443:8443 oie-dev
```

Then use [Ballista](https://github.com/kayyagari/ballista) to connect to
https://localhost:8443/ and login using admin admin.

## Build Environment

To build the solution, you must have a Java 1.8 JDK+FX and Apache Ant. This
can be installed by [sdkman](https://sdkman.io/) by executing `sdkman env install`.

## Build Process

From the `server/` directory, run `ant -f mirth-build.xml -DdisableSigning=true`.

If you are using Mirth Connect Administrator Launcher, you may need to omit
`-DdisableSigning=true` to support JWS signatures. Launchers like
[Ballista](https://github.com/kayyagari/ballista) do not require signing, and
signing adds considerable time to the build process.

## Run

After build, run the server by invoking `server/mirth-server-launcher.jar`. An
example of how to do this is listed in `docker/mirth-connect.sh`.
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# syntax=docker/dockerfile:1.7-labs

# Stages:
# 1. Builder Stage: Compiles the application and resolves dependencies. Produces
# JAR files that can be deployed.
# 1a. Install dependencies
# 1b. Build the application
# 2. Runner Stage: Creates a lightweight image that runs the application using the JRE.

FROM ubuntu:noble-20250415.1 AS builder
WORKDIR /app
# sdkman requires bash
SHELL ["/bin/bash", "-c"]

# Stage 1a: Install dependencies
# Install necessary tools
COPY .sdkmanrc .
RUN apt-get update\
&& apt-get install -y zip curl\
&& curl -s "https://get.sdkman.io?ci=true" | bash \
&& source "$HOME/.sdkman/bin/sdkman-init.sh" && sdk env install \
&& rm -rf /var/lib/apt/lists/*

# Stage 1b: Build the application
# Copy the entire source tree (excluding .dockerignore files), and build
COPY --exclude=docker . .
WORKDIR /app/server
RUN source "$HOME/.sdkman/bin/sdkman-init.sh" \
&& ANT_OPTS="-Dfile.encoding=UTF8" ant -f mirth-build.xml -DdisableSigning=true

# Stage 2: Runtime container
FROM eclipse-temurin:21.0.7_6-jre-noble

RUN groupadd mirth \
&& usermod -l mirth ubuntu \
&& adduser mirth mirth \
&& mkdir -p /opt/connect/appdata \
&& chown -R mirth:mirth /opt/connect

WORKDIR /opt/connect
COPY --chmod=0755 docker/entrypoint.sh docker/mirth-connect.sh ./
COPY --chown=mirth:mirth --from=builder \
--exclude=cli-lib \
--exclude=mirth-cli-launcher.jar \
--exclude=mccommand \
--exclude=manager-lib \
--exclude=mirth-manager-launcher.jar \
--exclude=mcmanager \
/app/server/setup ./

VOLUME /opt/connect/appdata
VOLUME /opt/connect/custom-extensions
EXPOSE 8443

USER mirth
ENTRYPOINT [ "/opt/connect/entrypoint.sh" ]
CMD ["/opt/connect/mirth-connect.sh"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
---
## Table of Contents

- [Quick-start](#quick-start)
- [Mission Statement](#mission-statement)
- [Overview](#overview)
- [Why Open Integration Engine?](#why-open-integration-engine)
Expand All @@ -19,6 +20,12 @@
- [Licensing](#licensing)
- [Acknowledgments](#acknowledgments)

---
## Quick-start

Start an instance of OIE with `docker run -p 8443:8443 ghcr.io/mgaffigan/oie` and
connect using [Ballista](https://github.com/kayyagari/ballista) to https://localhost:8443/ using login admin/admin.

---
## Mission Statement

Expand Down
Loading