commit 295edcd6930dddcb8124403400d00c87f275f2f3 Author: askiiart Date: Mon Nov 13 22:08:27 2023 -0600 Initial commit, definitely not done yet diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..50edc6f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,14 @@ +kind: pipeline +name: default + +steps: +- name: build and push + image: plugins/docker + pull: always + settings: + repo: askiiart/certbot-nginx + tags: latest + username: + from_secret: docker_username + password: + from_secret: docker_password \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c2e4cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.12-alpine +WORKDIR /etc/nginx +RUN pip install certbot certbot-nginx +RUN apk add nginx +COPY run.sh /root +ENTRYPOINT ["/root/run.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..102fe57 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# docker-createrepo_c + +[![Build Status](https://drone.askiiart.net/api/badges/askiiart/docker-certbot-nginx/status.svg?ref=refs/heads/main)](https://drone.askiiart.net/askiiart/docker-certbot-nginx) + +`createrepo_c` in a Docker container + +## Running + +Example `docker run`: + +```bash +docker run -d -e CERTBOT_DNS_PLUGIN=certbot-dns-cloudflare -v ./nginx-conf:/etc/nginx docker.askiiart.net/askiiart/certbot-nginx --version +``` + +Example `docker-compose.yml`: + +```yaml +version: '3.7' +services: + hugo: + image: docker.askiiart.net/askiiart/certbot-nginx + environment: + - CERTBOT_DNS_PLUGIN=certbot-dns-cloudflare + volumes: + - ./nginx-conf:/etc/nginx + command: --version +``` + +### Environment Variables + +| Variable | Description | Default | +| ------------------ | ----------------------------- | ------- | +| CERTBOT_DNS_PLUGIN | The certbot dns plugin to use | none | + +## Building + +1. Run `docker build .` diff --git a/build-and-push.sh b/build-and-push.sh new file mode 100755 index 0000000..2fa43d7 --- /dev/null +++ b/build-and-push.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e +ORG=askiiart +NAME=certbot-nginx +ID=$(docker build . -q) + +docker tag ${ID} ${ORG}/${NAME}:latest +docker push ${ORG}/${NAME}:latest diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..5bf8c78 --- /dev/null +++ b/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +if [ -z "$CERTBOT_DNS_PLUGIN" ]; then + echo "No DNS plugin set, continuing" +else + pip install $CERTBOT_DNS_PLUGIN +fi + +certbot $@ \ No newline at end of file