Skip to content

Commit

Permalink
dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
codeforkjeff committed Aug 25, 2022
1 parent 2779820 commit afd2dfd
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

####
## build container

FROM alpine:3.16.0 as build

WORKDIR /opt/conciliator

RUN apk --no-cache add alpine-conf git maven openjdk8

COPY conciliator.iml .
COPY conciliator.properties .
COPY pom.xml .

RUN mvn verify clean --fail-never

COPY src src

RUN mvn package

####
## application container

FROM alpine:3.16.0

EXPOSE 8080 8081

RUN apk --no-cache add alpine-conf openjdk8-jre

RUN setup-timezone -z America/Los_Angeles

COPY --from=build /opt/conciliator/target/conciliator*.jar .

CMD JARFILE=`find . -type f -name "conciliator*.jar" -print` && \
/usr/bin/java \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=8081 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-XX:+HeapDumpOnOutOfMemoryError \
-Xms256m -Xmx256m \
-Dlogging.level.com.codefork.refine=DEBUG -jar \
$JARFILE
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ instructions.

## Running Conciliator on Your Own Computer

Install Java 1.8 or greater if you don't already have it.
Using Docker is the easiest and preferred way to build and run the application:

```
docker build -t conciliator .
./run_docker.sh
```

If you don't have Docker, you can run the application as follows:

Install Java 8 if you don't already have it.

Download the .jar file for the
[latest release](https://github.com/codeforkjeff/conciliator/releases). Alternatively,
Expand Down
3 changes: 3 additions & 0 deletions run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker run -d --restart always -p 127.0.0.1:8080:8080 -p 127.0.0.1:8081:8081 -v "$(pwd)/conciliator.log:/opt/conciliator/conciliator.log" conciliator:latest

0 comments on commit afd2dfd

Please sign in to comment.