diff --git a/.forgejo/workflows/ente.yaml b/.forgejo/workflows/ente.yaml new file mode 100644 index 0000000..8e3d860 --- /dev/null +++ b/.forgejo/workflows/ente.yaml @@ -0,0 +1,32 @@ +--- +name: Image builds +on: + push: + branches: + - main + +jobs: + build-ente-images: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: code.icb4dc0.de + username: prskr + password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} + + - name: Fetch latest ente photos tag + run: | + echo "ENTE_PHOTOS_VERSION=$(gh release list -R ente-io/ente --exclude-pre-releases --exclude-drafts --jq '.[] | select(.tagName | startswith("photos")) | .tagName' --json 'tagName' --limit 1)" >> "$GITHUB_ENV" + env: + GH_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }} + + - name: Test ente version + run: | + echo "$ENTE_PHOTOS_VERSION" \ No newline at end of file diff --git a/act_runtime/Dockerfile b/act_runtime/Dockerfile index d0b614d..8fbeb7f 100644 --- a/act_runtime/Dockerfile +++ b/act_runtime/Dockerfile @@ -1,11 +1,14 @@ +# syntax=docker/dockerfile:1 ARG BASE_IMAGE=node:20-bookworm-slim FROM ${BASE_IMAGE} ARG LLVM_VERSION=16 +# common tools RUN --mount=type=cache,target=/var/lib/apt \ --mount=type=cache,target=/var/lib/cache \ + --mount=type=cache,target=/var/cache/apt \ apt-get update && \ apt-get install -y \ sudo \ @@ -23,11 +26,19 @@ RUN --mount=type=cache,target=/var/lib/apt \ libgraphite2-3 \ zstd && \ ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/clang /usr/bin/clang && \ - ln -s -f /usr/lib/llvm-${LLVM_VERSION}/bin/llc /usr/bin/ && \ - mkdir -p /etc/apt/keyrings/ && \ - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ + ln -s -f /usr/lib/llvm-${LLVM_VERSION}/bin/llc /usr/bin/ + +ADD --chmod=444 https://cli.github.com/packages/githubcli-archive-keyring.gpg /etc/apt/keyrings/githubcli-archive-keyring.gpg +ADD --chmod=444 https://download.docker.com/linux/debian/gpg /etc/apt/keyrings/docker.asc + +# Docker and other tools +RUN --mount=type=cache,target=/var/lib/apt \ + --mount=type=cache,target=/var/lib/cache \ + --mount=type=cache,target=/var/cache/apt \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list && \ echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" > /etc/apt/sources.list.d/docker.list && \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list && \ apt-get update && \ - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin \ No newline at end of file + apt-get install -y \ + gh \ + docker-ce docker-ce-cli containerd.io docker-buildx-plugin \ \ No newline at end of file diff --git a/ente/web/Dockerfile b/ente/web/Dockerfile new file mode 100644 index 0000000..0f6d15e --- /dev/null +++ b/ente/web/Dockerfile @@ -0,0 +1,53 @@ +# syntax=docker/dockerfile:1 +FROM node:21-bookworm-slim as ente-builder + +ENV NEXT_PUBLIC_ENTE_ENDPOINT=DOCKER_RUNTIME_REPLACE_ENDPOINT \ + NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=DOCKER_RUNTIME_REPLACE_ALBUMS_ENDPOINT + +RUN apt update && apt install -y ca-certificates git git-lfs && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +RUN git clone --recursive --depth=1 --shallow-submodules https://github.com/ente-io/ente.git . + +WORKDIR /app/web + +RUN yarn install && \ + yarn build + + +FROM nginx:1.25-alpine-slim +COPY --from=ente-builder /app/web/apps/photos/out /usr/share/nginx/html +COPY <