forked from WalkerKnapp/LumaBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 1.23 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Build web component
FROM node:24-alpine AS web_build
WORKDIR /luma
COPY web web
RUN cd web && npm install && npm run build
# Build server component
FROM gradle:jdk24-alpine AS server_build
WORKDIR /luma
COPY gradle gradle
COPY server server
COPY build.gradle settings.gradle gradlew gradlew.bat luma-schema.sql ./
RUN gradle installDist
# Create a custom Java runtime to minimize image size
FROM eclipse-temurin:24-alpine AS jre_build
RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.desktop,java.management,java.sql,java.naming,jdk.unsupported \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress='zip-6' \
--output /javaruntime
# Install server and web components
FROM alpine
WORKDIR /luma
RUN mkdir -p web/dist
COPY --from=web_build /luma/web/dist web/dist
COPY --from=server_build /luma/server/build/install .
COPY --from=server_build /luma/luma-schema.sql server/luma-schema.sql
RUN mkdir server/locales
COPY --from=server_build /luma/server/locales server/locales
# Install custom java runtime
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH="${JAVA_HOME}/bin:${PATH}"
COPY --from=jre_build /javaruntime $JAVA_HOME
WORKDIR /luma/server
EXPOSE 80
ENTRYPOINT ./bin/server