hassio-nextcloud-backup/nextcloud_backup/Dockerfile

74 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
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
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}