This commit is contained in:
2025-10-04 16:08:55 -07:00
parent 03b5bf85aa
commit 3a4563a34d
9 changed files with 1714 additions and 127 deletions

62
Makefile Normal file
View File

@@ -0,0 +1,62 @@
# Makefile for Fitbit to Garmin Weight Sync Docker Application
# Variables
IMAGE = fitbit-garmin-sync
DATA_DIR = data
VOLUME = -v "$(PWD)/$(DATA_DIR)":/app/data
CONTAINER_NAME = fitbit-sync
# Default target
.PHONY: help
help:
@echo "Available targets:"
@echo " build - Build the Docker image"
@echo " data - Create the data directory for persistence"
@echo " run - Run the application in scheduled sync mode (detached)"
@echo " setup - Run interactive setup for credentials"
@echo " sync - Run manual sync"
@echo " status - Check application status"
@echo " stop - Stop the running container"
@echo " clean - Stop and remove container, remove image"
@echo " help - Show this help message"
# Build the Docker image
.PHONY: build
build:
docker build -t $(IMAGE) .
# Create data directory
.PHONY: data
data:
mkdir -p $(DATA_DIR)
# Run the scheduled sync (detached)
.PHONY: run
run: build data
docker run -d --name $(CONTAINER_NAME) $(VOLUME) $(IMAGE)
# Interactive setup
.PHONY: setup
setup: build data
docker run -it --rm $(VOLUME) $(IMAGE) setup
# Manual sync
.PHONY: sync
sync: build data
docker run -it --rm $(VOLUME) $(IMAGE) sync
# Check status
.PHONY: status
status: build data
docker run -it --rm $(VOLUME) $(IMAGE) status
# Stop the running container
.PHONY: stop
stop:
docker stop $(CONTAINER_NAME) || true
docker rm $(CONTAINER_NAME) || true
# Clean up: stop container, remove image
.PHONY: clean
clean: stop
docker rmi $(IMAGE) || true