Adpat frontend to build docker image with buildah
This commit is contained in:
@@ -175,10 +175,23 @@ sdk use java 25-graalce
|
||||
|
||||
# Build native executable + Docker image (requires Docker daemon)
|
||||
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)
|
||||
|
||||
|
||||
+5
-2
@@ -164,10 +164,13 @@
|
||||
<image>gcr.io/distroless/base-nossl-debian12</image>
|
||||
</from>
|
||||
<to>
|
||||
<!-- override at build time: -Djib.to.image=registry/org/image:tag -->
|
||||
<image>ai-teacher-backend</image>
|
||||
<image>zot.immich-ad.ovh/home/ai-teacher-backend</image>
|
||||
<tags>
|
||||
<tag>latest</tag>
|
||||
</tags>
|
||||
</to>
|
||||
<container>
|
||||
<format>OCI</format>
|
||||
<ports>
|
||||
<port>8080</port>
|
||||
</ports>
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
# ---- Build stage ----
|
||||
FROM node:20-alpine AS build
|
||||
FROM docker.io/library/node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
@@ -7,7 +7,7 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ---- Runtime stage (nginx) ----
|
||||
FROM nginx:alpine
|
||||
FROM docker.io/library/nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user