hassio-nextcloud-backup/nextcloud_backup/Dockerfile

77 lines
1.8 KiB
Docker
Raw Normal View History

2024-08-13 13:50:42 +02:00
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base:3.18
2024-08-13 15:35:48 +02:00
FROM node:22-alpine 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
2024-08-13 15:35:48 +02:00
FROM node:22-alpine 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 ./
2022-05-01 14:13:21 +02:00
RUN corepack enable
2024-08-13 13:23:32 +02:00
RUN pnpm install
2019-12-19 15:08:47 +01:00
# Copy all source code
2024-08-13 13:23:32 +02:00
COPY --from=backend-builder /app/dist .
COPY --from=frontend-builder /app/dist ./public
2019-12-19 15:08:47 +01:00
# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
ARG IMAGE_SOURCE
2019-12-19 15:08:47 +01:00
# Labels
LABEL \
io.hass.name="Nextcloud Backup" \
io.hass.description="Addon that backup your snapshot to a Nextcloud server" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Sebclem" \
org.label-schema.description="Addon that backup your snapshot to a Nextcloud server" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Nextcloud Backup" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://addons.community" \
2024-08-13 13:23:32 +02:00
org.label-schema.usage="https://github.com/Sebclem/hassio-nextcloud-backup/tree/master/README.md" \
2019-12-19 15:08:47 +01:00
org.label-schema.vcs-ref=${BUILD_REF} \
2024-08-13 13:23:32 +02:00
org.label-schema.vcs-url="https://github.com/Sebclem/hassio-nextcloud-backup" \
org.label-schema.vendor="Sebclem"\
org.opencontainers.image.source=${IMAGE_SOURCE}