|
| 1 | +# ============================================================================= |
| 2 | +# Stage 1: Build frontend |
| 3 | +# ============================================================================= |
| 4 | +FROM registry.access.redhat.com/ubi9/nodejs-24:latest AS frontend-builder |
| 5 | + |
| 6 | +USER 0 |
| 7 | +WORKDIR /app |
| 8 | + |
| 9 | +RUN npm install -g pnpm@10.29.2 |
| 10 | + |
| 11 | +COPY frontend/package.json frontend/pnpm-lock.yaml ./ |
| 12 | +RUN pnpm install --frozen-lockfile |
| 13 | + |
| 14 | +COPY frontend/ ./ |
| 15 | +RUN pnpm run build |
| 16 | + |
| 17 | +# ============================================================================= |
| 18 | +# Stage 2: Build Go backend |
| 19 | +# ============================================================================= |
| 20 | +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25 AS builder |
| 21 | + |
| 22 | +COPY . . |
| 23 | +WORKDIR $APP_ROOT/app/ |
| 24 | +COPY go.mod go.mod |
| 25 | +COPY go.sum go.sum |
| 26 | +RUN go mod download |
| 27 | +COPY . . |
| 28 | +COPY --from=frontend-builder /app/dist ./frontend/dist |
| 29 | + |
| 30 | +ENV BUILDTAGS strictfipsruntime |
| 31 | +ENV GOEXPERIMENT strictfipsruntime |
| 32 | +RUN CGO_ENABLED=1 GOOS=linux go build -tags "$BUILDTAGS" -mod=mod -a -o filebrowser . |
| 33 | + |
| 34 | +# ============================================================================= |
| 35 | +# Stage 3: Runtime image |
| 36 | +# ============================================================================= |
| 37 | +FROM registry.redhat.io/ubi9/ubi:latest |
| 38 | + |
| 39 | +COPY --from=builder $APP_ROOT/app/filebrowser /filebrowser |
| 40 | + |
| 41 | +USER 65532:65532 |
| 42 | + |
| 43 | +EXPOSE 8080 |
| 44 | + |
| 45 | +ENTRYPOINT ["/filebrowser"] |
| 46 | +CMD [] |
| 47 | + |
| 48 | +LABEL description="OADP VM file restore file browser" |
| 49 | +LABEL io.k8s.description=" OADP VM file restore file browser" |
| 50 | +LABEL io.k8s.display-name="OADP File Browser" |
| 51 | +LABEL io.openshift.tags="filebrowser,filemanager,web" |
| 52 | +LABEL summary="OADP File Browser" |
0 commit comments