Adpat frontend to build docker image with buildah

This commit is contained in:
Adrien
2026-04-09 19:36:22 +02:00
parent 8e227a9429
commit d8a5bb9340
3 changed files with 22 additions and 6 deletions
+15 -2
View File
@@ -175,10 +175,23 @@ sdk use java 25-graalce
# Build native executable + Docker image (requires Docker daemon) # Build native executable + Docker image (requires Docker daemon)
cd backend cd backend
mvn -Pnative package jib:dockerBuild -DskipTests mvn -Pnative package jib:build -DskipTests
mvn -Pnative jib:build -Djib.to.auth.username=admin -Djib.to.auth.password=""
``` ```
The image `ai-teacher-backend:latest` will appear in your local Docker. It starts in under 1 second and uses significantly less memory than the JVM image. ### Frontend build
```
buildah build \
--platform linux/arm64 \
--tag ai-teacher-frontend:latest \
frontend/
```
To export it as a tarball:
```
buildah push ai-teacher-frontend:latest \
oci-archive:/tmp/ai-teacher-frontend-arm64.tar
```
### Run Native Stack (Docker Compose) ### Run Native Stack (Docker Compose)
+5 -2
View File
@@ -164,10 +164,13 @@
<image>gcr.io/distroless/base-nossl-debian12</image> <image>gcr.io/distroless/base-nossl-debian12</image>
</from> </from>
<to> <to>
<!-- override at build time: -Djib.to.image=registry/org/image:tag --> <image>zot.immich-ad.ovh/home/ai-teacher-backend</image>
<image>ai-teacher-backend</image> <tags>
<tag>latest</tag>
</tags>
</to> </to>
<container> <container>
<format>OCI</format>
<ports> <ports>
<port>8080</port> <port>8080</port>
</ports> </ports>
+2 -2
View File
@@ -1,5 +1,5 @@
# ---- Build stage ---- # ---- Build stage ----
FROM node:20-alpine AS build FROM docker.io/library/node:20-alpine AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm ci RUN npm ci
@@ -7,7 +7,7 @@ COPY . .
RUN npm run build RUN npm run build
# ---- Runtime stage (nginx) ---- # ---- Runtime stage (nginx) ----
FROM nginx:alpine FROM docker.io/library/nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80