-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 1.08 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# syntax=docker/dockerfile:1
# ---- build stage: compile the fat jar with JDK 21 + Maven ----
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /src
COPY . .
RUN mvn -q -pl gokit-app -am package -DskipTests
# ---- runtime stage: run it on a JRE ----
FROM eclipse-temurin:21-jre
LABEL org.opencontainers.image.title="GoKit" \
org.opencontainers.image.description="Amateur radio emergency communications" \
org.opencontainers.image.licenses="GPL-3.0-or-later"
WORKDIR /app
COPY --from=build /src/gokit-app/target/gokit.jar /app/gokit.jar
# /data holds the JSON config, mailbox, net logs and profiles — mount a volume here.
RUN mkdir -p /data && useradd -r -u 1001 -d /data gokit && chown gokit /data
USER gokit
VOLUME /data
# Web UI port (used when running `web --host 0.0.0.0`).
EXPOSE 8080
# The entrypoint is the gokit CLI, so any subcommand works:
# docker run --rm -v "$PWD/data:/data" gokit mail -c /data/gokit.json
# docker run --rm -p 8080:8080 -v "$PWD/data:/data" gokit web -c /data/gokit.json --host 0.0.0.0
ENTRYPOINT ["java", "-jar", "/app/gokit.jar"]
CMD ["--help"]