hassio-nextcloud-backup/nextcloud_backup/Dockerfile

48 lines
866 B
Docker
Raw Normal View History

2024-08-13 13:50:42 +02:00
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base:3.18
FROM node:20 AS frontend-builder
2024-08-13 13:23:32 +02:00
WORKDIR /app
COPY frontend/package.json frontend/pnpm-lock.yaml ./
RUN corepack enable
RUN pnpm install
COPY frontend/ .
RUN pnpm build
FROM node:20 AS backend-builder
2024-08-13 13:23:32 +02:00
WORKDIR /app
COPY backend/package.json backend/pnpm-lock.yaml ./
RUN corepack enable
RUN pnpm install
COPY backend/ .
RUN pnpm build
2024-08-13 13:47:22 +02:00
FROM $BUILD_FROM
2019-12-19 15:08:47 +01:00
# Copy root filesystem
COPY rootfs/etc /etc/
COPY rootfs/usr /usr/
2019-12-19 15:08:47 +01:00
# Setup base
2022-05-01 15:52:34 +02:00
RUN apk add --no-cache nodejs-current
# Fix for arm/v7
RUN mkdir -p /usr/local/sbin/
RUN ln -s /usr/bin/node /usr/local/sbin/node
2019-12-19 15:08:47 +01:00
WORKDIR /opt/nextcloud_backup/
2024-08-13 13:23:32 +02:00
COPY backend/package.json backend/pnpm-lock.yaml ./
COPY --from=backend-builder /app/dist .
2024-08-13 15:53:02 +02:00
COPY --from=backend-builder /app/node_modules ./node_modules
2024-08-13 13:23:32 +02:00
COPY --from=frontend-builder /app/dist ./public