mirror of
https://github.com/jung-geun/DynamicDNS-SSL.git
synced 2025-12-19 20:44:40 +09:00
Refactor Dockerfile to use Python 3.11-slim
This commit is contained in:
42
Makefile
42
Makefile
@@ -1,41 +1,25 @@
|
||||
IMAGE_NAME = "cloudflare-ddns"
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
default: build
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
.PHONY: build
|
||||
build: stop
|
||||
docker build -t $(IMAGE_NAME) .
|
||||
|
||||
.PHONY: run
|
||||
run:
|
||||
docker run --rm --privileged=true -d -v /opt/cloudflare-ddns/config:/app/cloudflare-ddns/config $(IMAGE_NAME)
|
||||
|
||||
.PHONY: stop
|
||||
stop:
|
||||
@container_id=$$(docker ps -q -f ancestor=$(IMAGE_NAME)); \
|
||||
if [ -n "$$container_id" ]; then \
|
||||
echo "Stopping container $$container_id"; \
|
||||
docker stop $$container_id; \
|
||||
else \
|
||||
echo "No running container found for image $(IMAGE_NAME)"; \
|
||||
fi
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Usage: make [target]"
|
||||
@echo ""
|
||||
@echo "Targets:"
|
||||
@echo " install Install the required dependencies"
|
||||
@echo " certbot Install certbot"
|
||||
@echo " uninstall Uninstall the installed dependencies"
|
||||
@echo ""
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
@echo "Installing cloudflare-ddns"
|
||||
@scripts/install.sh
|
||||
|
||||
.PHONY: certbot
|
||||
certbot:
|
||||
@echo "Installing certbot"
|
||||
@scripts/certbot.sh
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -rf /app/cloudflare-ddns
|
||||
@rm -rf /app/certbot
|
||||
@rm /etc/cron.d/cloudflare-ddns
|
||||
@rm /var/log/cloudflare_ddns.log
|
||||
@rm /var/log/cloudflare_ddns.log.*
|
||||
@echo "Done"
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
@scripts/uninstall.sh
|
||||
|
||||
Reference in New Issue
Block a user