From 4177940a93bb2cbc454afed4576cd634f6730afe Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 18 Sep 2024 12:32:42 +0200 Subject: [PATCH] initial commit --- .gitea/workflows/container.yaml | 12 ++++++++++++ .gitignore | 3 +++ Containerfile | 31 +++++++++++++++++++++++++++++++ README.md | 10 ++++++++++ 4 files changed, 56 insertions(+) create mode 100644 .gitea/workflows/container.yaml create mode 100644 .gitignore create mode 100644 Containerfile create mode 100644 README.md diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml new file mode 100644 index 0000000..e48b3fd --- /dev/null +++ b/.gitea/workflows/container.yaml @@ -0,0 +1,12 @@ +name: Build Multiarch Container Image +on: [push] +jobs: + call-reusable-workflow: + uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main + with: + repository: ${{ gitea.repository }} + ref_name: ${{ gitea.ref_name }} + sha: ${{ gitea.sha }} + registry_url: ${{ secrets.REGISTRY_URL }} + registry_user: ${{ secrets.REGISTRY_USER }} + registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..af0faab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +.DS_Store +*.swp diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..6b89984 --- /dev/null +++ b/Containerfile @@ -0,0 +1,31 @@ +FROM docker.io/rust:1-alpine3.20 AS builder + +RUN mkdir /db +RUN echo "tasker:x:2222:2222:Linux User,,,:/:/app" > /passwd + +RUN apk --no-cache add \ + musl-dev \ + git + +ENV CARGO_CARGO_NEW_VCS="none" +ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static" + +ENV VERSION=af918bdf0dea7f7b6e920680c947fc37b37ffffb +RUN git clone https://github.com/GothenburgBitFactory/taskchampion-sync-server.git /work +WORKDIR /work +RUN git checkout "$VERSION" + +RUN cargo build --release --target=$(arch)-unknown-linux-musl +RUN cp "./target/$(arch)-unknown-linux-musl/release/taskchampion-sync-server" /app + +FROM scratch + +COPY --from=builder /passwd /etc/passwd +COPY --from=builder /app /app +COPY --from=builder --chown=2222: /db /db + +USER tasker + +ENTRYPOINT ["/app", "--data-dir", "/db", "--port", "8080"] +EXPOSE 8080 +VOLUME ["/db"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..585e681 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +[TaskChampion Sync-Server](https://github.com/GothenburgBitFactory/taskchampion-sync-server) +to sync [Taskwarrior](https://taskwarrior.org/) data. + +# Volumes + +- `/db`: data persistence + +# Ports + +- 8080