diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index 7a6bb4f..584e6aa 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -53,6 +53,18 @@ jobs: registry: ${{ env.GH_REGISTRY }} username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Define metadata variables + run: | + sed -i "s/ARG githash=.*/ARG githash=${{ github.sha }}/" Dockerfile + sed -i "s/ARG created=.*/ARG created=$(date -u +'%Y-%m-%dT%H:%M:%S%:z')/" Dockerfile + cat Dockerfile + + - name: Define metadata variables + if: startsWith(github.ref, 'refs/tags/v') + run: | + sed -i "s/ARG version=.*/ARG version=${{ github.ref_name }}/" Dockerfile + cat Dockerfile - name: Extract metadata for release Docker image if: startsWith(github.ref, 'refs/tags/v') diff --git a/Dockerfile b/Dockerfile index 349981f..74d4b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,21 @@ RUN npx tsc && npm run-script build && \ FROM base AS deploy +ARG version=develop +ARG githash=REVISION +ARG created=CREATED + +LABEL org.opencontainers.image.title="chore-chart" +LABEL org.opencontainers.image.description="Front end for Grocy chore lists" +LABEL org.opencontainers.image.authors="Cory Sanin " +LABEL org.opencontainers.image.url="https://git.sanin.dev/corysanin/chore-chart" +LABEL org.opencontainers.image.documentation="https://git.sanin.dev/corysanin/chore-chart" +LABEL org.opencontainers.image.source="https://git.sanin.dev/corysanin/chore-chart" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.version="${version}" +LABEL org.opencontainers.image.revision="${githash}" +LABEL org.opencontainers.image.created="${created}" + HEALTHCHECK --timeout=3s \ CMD curl --fail http://localhost:8080/healthcheck || exit 1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3ddf601 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Cory Sanin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.