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 0908355704
3 changed files with 23 additions and 6 deletions
+16 -2
View File
@@ -175,10 +175,24 @@ 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 zot.immich-ad.ovh/ai-teacher-frontend:latest \
frontend/
buildah login zot.immich-ad.ovh
```
Push to the private repository:
```
buildah push --tls-verify=false zot.immich-ad.ovh/ai-teacher-frontend:latest
```
### 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