diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e0b4513..0000000 --- a/.drone.yml +++ /dev/null @@ -1,28 +0,0 @@ -kind: pipeline -name: default - -steps: - - name: build and publish monica docker image - image: plugins/docker - settings: - registry: gitea.sikorski.cloud - username: rogersik - password: - from_secret: "gitea_token" - repo: gitea.sikorski.cloud/rogersik/docker-monica - tags: latest,4 - cache_from: gitea.sikorski.cloud/rogersik/docker-monica:latest - - - name: notify - image: drillster/drone-email - settings: - host: mailcow.basecom.de - from: - from_secret: "Notifications_Address" - username: - from_secret: "Notifications_Address" - password: - from_secret: "Notifications_Address_Password" - recipients: [roger@sikorski.cloud] - when: - status: [failure] diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml new file mode 100644 index 0000000..c00e210 --- /dev/null +++ b/.gitea/workflows/dev.yaml @@ -0,0 +1,31 @@ +name: docker-monica-build mr + +on: + push: + branches-ignore: + - main + +jobs: + Dockerfile lint: + runs-on: k3s + steps: + - uses: actions/checkout@v3 + - uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + + build: + needs: Dockerfile lint + runs-on: docker + steps: + - uses: actions/checkout@v3 + - name: Pull Docker Image for caching + run: docker pull gitea.sikorski.cloud/rogersik/monica:development || exit 0 + - name: Build docker image + run: | + docker build . \ + --cache-from gitea.sikorski.cloud/rogersik/monica:development \ + --file Dockerfile \ + --tag gitea.sikorski.cloud/rogersik/monica:development + - name: Push docker image + run: docker push gitea.sikorski.cloud/rogersik/monica --all-tags diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml new file mode 100644 index 0000000..6b13961 --- /dev/null +++ b/.gitea/workflows/main.yaml @@ -0,0 +1,34 @@ +--- +name: docker-monica-build main +on: + push: + branches: + - main + schedule: + - cron: "0 6 * * SUN" + +jobs: + Dockerfile lint: + runs-on: k3s + steps: + - uses: actions/checkout@v3 + - uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + + build: + needs: Dockerfile lint + runs-on: docker + steps: + - uses: actions/checkout@v3 + - name: Pull Docker Image for caching + run: docker pull gitea.sikorski.cloud/rogersik/monica:latest || exit 0 + - name: Build docker image + run: | + docker build . \ + --cache-from gitea.sikorski.cloud/rogersik/monica:latest \ + --file Dockerfile \ + --tag gitea.sikorski.cloud/rogersik/monica:latest + --tag gitea.sikorski.cloud/rogersik/monica:4 + - name: Push docker image + run: docker push gitea.sikorski.cloud/rogersik/monica --all-tags diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..81540f9 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3008 # no need to pin versions diff --git a/Dockerfile b/Dockerfile index 7000346..53c8cf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ # https://hub.docker.com/_/monica FROM monica:4 -# Use the default production configuration -RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" -# increase php upload limit -RUN sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/' "$PHP_INI_DIR/php.ini" +RUN \ + # Use the default production configuration + mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \ + # increase php upload limit + sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/' "$PHP_INI_DIR/php.ini" # supervisord dependencies RUN apt-get update && \