summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile20
1 files changed, 12 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index 30c099e..84e02b2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-# Build + test stage: a failing test fails the image build, which is what lizCI checks.
+# Build stage: tests and every download. A failing test fails the image build, which is what lizCI checks.
FROM eclipse-temurin:21-jdk AS build
WORKDIR /src
# Android SDK: core and ui have Android targets, so Gradle needs one even for the desktop build.
@@ -16,11 +16,15 @@ COPY desktop/build.gradle.kts desktop/
COPY android/build.gradle.kts android/
RUN ./gradlew --no-daemon -q help
COPY . .
-RUN ./gradlew --no-daemon :core:jvmTest :desktop:createDistributable
-
-# Artifact image: just the packaged Linux desktop app (with its bundled runtime).
-FROM alpine:3.20 AS rookery
+# Tests, then every download: the Linux app (with its runtime), the universal jar and the Android APK.
+RUN ./gradlew --no-daemon :core:jvmTest :desktop:createDistributable :desktop:universalJar :android:assembleDebug
+# The commit goes in last, so a new commit doesn't redo the build above's cache-able layers.
ARG COMMIT=unknown
-COPY --from=build /src/desktop/build/compose/binaries/main/app/rookery /opt/rookery
-RUN printf '%s' "$COMMIT" > /opt/rookery/commit
-CMD ["ls", "/opt/rookery"]
+RUN sh site/assemble.sh /site "$COMMIT"
+
+# The deployed image: a static download page and the files it links to.
+FROM nginx:alpine AS rookery
+COPY site/nginx.conf /etc/nginx/conf.d/default.conf
+RUN rm -f /usr/share/nginx/html/index.html /usr/share/nginx/html/50x.html
+COPY --from=build /site /usr/share/nginx/html
+EXPOSE 80