-
Notifications
You must be signed in to change notification settings - Fork 41
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # For developers and contributors | ||
|
|
||
| ## Build and run locally | ||
|
|
||
| To build the solution, you must have a Java 17 JDK+FX and Apache Ant. This | ||
| can be installed by [sdkman](https://sdkman.io/) by executing `sdk env install`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC SDKMan isn't supported on windows. Do you need separate *nix, mac, and winderz instructions?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think *nix and mac can go as is, but windows should be clarified, yes. This also needs to be updated for the new Java 17 minimum build.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated language to address windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI the cli interface for sdkman start to be rewrite in Rust and also available on Windows. |
||
| From the `server/` directory, run `ant -f mirth-build.xml -DdisableSigning=true`. | ||
|
|
||
| After build, run the server by invoking `server/setup/oieserver` in bash or | ||
| `server/setup/oieserver.ps1` in PowerShell. | ||
|
|
||
| > [!NOTE] | ||
| > SDKMAN does not support Windows. You can build within a container or WSL2, or | ||
| > manually install the JDK and Ant and add them to your PATH. | ||
|
|
||
| ## Build and run 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 | ||
| ``` | ||
|
|
||
| ## Connect | ||
|
|
||
| Then use [Ballista](https://github.com/kayyagari/ballista) to connect to | ||
| https://localhost:8443/ and login using admin admin. | ||
|
|
||
| If you are using Mirth Connect Administrator Launcher, you may need to omit | ||
mgaffigan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| `-DdisableSigning=true` to support JWS signatures and run MCAL passing `-k -d` | ||
| to make it ignore self-signed certificates. Launchers like | ||
| [Ballista](https://github.com/kayyagari/ballista) do not require signing, and | ||
| signing adds considerable time to the build process. | ||
mgaffigan marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # syntax=docker/dockerfile:1 | ||
mgaffigan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # 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-20251013 AS builder | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am unopposed to |
||
| 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 \ | ||
kpalang marked this conversation as resolved.
Show resolved
Hide resolved
mgaffigan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| && 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 | ||
|
|
||
| ########################################## | ||
| # | ||
| # Ubuntu JDK Image | ||
| # | ||
| ########################################## | ||
|
|
||
| FROM eclipse-temurin:21.0.9_10-jdk-noble AS jdk-run | ||
|
|
||
| RUN groupadd engine \ | ||
| && usermod -l engine ubuntu \ | ||
| && adduser engine engine \ | ||
| && mkdir -p /opt/engine/appdata \ | ||
| && chown -R engine:engine /opt/engine | ||
|
|
||
| WORKDIR /opt/engine | ||
| COPY --chown=engine:engine --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/engine/appdata | ||
| VOLUME /opt/engine/custom-extensions | ||
| EXPOSE 8443 | ||
|
|
||
| USER engine | ||
| ENTRYPOINT ["./configure-from-env.sh"] | ||
| CMD ["./oieserver"] | ||
|
|
||
| ########################################## | ||
| # | ||
| # Alpine JRE Image | ||
| # | ||
| ########################################## | ||
|
|
||
| FROM eclipse-temurin:21.0.9_10-jre-alpine AS jre-run | ||
|
|
||
| # Alpine does not include bash by default, so we install it | ||
| RUN apk add --no-cache bash | ||
| # useradd and groupadd are not available in Alpine | ||
| RUN addgroup -S engine \ | ||
| && adduser -S -g engine engine \ | ||
| && mkdir -p /opt/engine/appdata \ | ||
| && chown -R engine:engine /opt/engine | ||
|
|
||
| WORKDIR /opt/engine | ||
| COPY --chown=engine:engine --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/engine/appdata | ||
| VOLUME /opt/engine/custom-extensions | ||
|
|
||
| EXPOSE 8443 | ||
|
|
||
| USER engine | ||
| ENTRYPOINT ["./configure-from-env"] | ||
| CMD ["./oieserver"] | ||
Uh oh!
There was an error while loading. Please reload this page.