From e05d3ebe59b63451f5de134afe65b2afa0429ee3 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 8 Feb 2022 12:17:13 +0100 Subject: [PATCH] Add cgi scripts --- .drone-manifest-fcgi.yml | 22 ++++++++++++ .drone.yml | 78 ++++++++++++++++++++++++++++++++++------ Dockerfile.fcgi | 13 +++++++ 3 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 .drone-manifest-fcgi.yml create mode 100644 Dockerfile.fcgi diff --git a/.drone-manifest-fcgi.yml b/.drone-manifest-fcgi.yml new file mode 100644 index 0000000..5c20429 --- /dev/null +++ b/.drone-manifest-fcgi.yml @@ -0,0 +1,22 @@ +image: nemunaire/nagios-fcgi:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - image: nemunaire/nagios-fcgi:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - image: nemunaire/nagios-fcgi:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - image: nemunaire/nagios-fcgi:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/.drone.yml b/.drone.yml index 1eec4e8..66345b1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,17 +8,32 @@ platform: arch: amd64 steps: - - name: docker build and publish +# - name: docker build and publish +# image: plugins/docker +# settings: +# username: +# from_secret: docker_username +# password: +# from_secret: docker_password +# repo: nemunaire/nagios +# auto_tag: true +# auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} +# dockerfile: Dockerfile +# when: +# branch: +# - master + + - name: build fcgi image image: plugins/docker settings: username: from_secret: docker_username password: from_secret: docker_password - repo: nemunaire/nagios + repo: nemunaire/nagios-fcgi auto_tag: true auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} - dockerfile: Dockerfile + dockerfile: Dockerfile.fcgi when: branch: - master @@ -39,17 +54,32 @@ platform: arch: arm64 steps: - - name: docker build and publish +# - name: docker build and publish +# image: plugins/docker +# settings: +# username: +# from_secret: docker_username +# password: +# from_secret: docker_password +# repo: nemunaire/nagios +# auto_tag: true +# auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} +# dockerfile: Dockerfile +# when: +# branch: +# - master + + - name: build fcgi image image: plugins/docker settings: username: from_secret: docker_username password: from_secret: docker_password - repo: nemunaire/nagios + repo: nemunaire/nagios-fcgi auto_tag: true auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} - dockerfile: Dockerfile + dockerfile: Dockerfile.fcgi when: branch: - master @@ -70,17 +100,32 @@ platform: arch: arm steps: - - name: docker build and publish +# - name: docker build and publish (nagios) +# image: plugins/docker +# settings: +# username: +# from_secret: docker_username +# password: +# from_secret: docker_password +# repo: nemunaire/nagios +# auto_tag: true +# auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} +# dockerfile: Dockerfile +# when: +# branch: +# - master + + - name: build fcgi image image: plugins/docker settings: username: from_secret: docker_username password: from_secret: docker_password - repo: nemunaire/nagios + repo: nemunaire/nagios-fcgi auto_tag: true auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} - dockerfile: Dockerfile + dockerfile: Dockerfile.fcgi when: branch: - master @@ -95,12 +140,23 @@ trigger: kind: pipeline name: docker-manifest steps: - - name: publish manifest +# - name: publish manifest +# image: plugins/manifest +# settings: +# auto_tag: true +# ignore_missing: true +# spec: .drone-manifest.yml +# username: +# from_secret: docker_username +# password: +# from_secret: docker_password + + - name: publish fcgi manifest image: plugins/manifest settings: auto_tag: true ignore_missing: true - spec: .drone-manifest.yml + spec: .drone-manifest-fcgi.yml username: from_secret: docker_username password: diff --git a/Dockerfile.fcgi b/Dockerfile.fcgi new file mode 100644 index 0000000..6f64903 --- /dev/null +++ b/Dockerfile.fcgi @@ -0,0 +1,13 @@ +FROM alpine + +RUN adduser -S -s /sbin/nologin -h /var/www/localhost/htdocs -u 80 -G www-data www-data && \ + apk add --no-cache \ + fcgiwrap \ + nagios \ + nagios-web \ + && \ + addgroup www-data nagios + +EXPOSE 8080 +USER www-data +CMD ["/usr/bin/fcgiwrap", "-s", "tcp:0.0.0.0:8080"]