diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4c1127c --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +# Path to the Docker context directory +SDR_NODE_CONTEXT = $(shell pwd) + +# Path to the .env file +ENV_FILE = $(SDR_NODE_CONTEXT)/.env + +# Variables +IMAGE_NAME = op25-client +CONTAINER_NAME = op25-client + +# Target to build the Docker image for sdr-node +build: + docker build -t $(IMAGE_NAME) $(SDR_NODE_CONTEXT) + +# Target to run the sdr-node container +run: build + docker run --rm -it \ + --privileged \ + -v /dev:/dev \ + -v $(shell pwd)/configs:/configs \ + -v $(shell pwd)/app:/app \ + --name $(CONTAINER_NAME) \ + --network=host \ + $(IMAGE_NAME) + +# Deploy docker +deploy: build + docker run --rm -d \ + --privileged \ + -v /dev:/dev \ + -v $(shell pwd)/configs:/configs \ + --name $(CONTAINER_NAME) \ + --network=host \ + $(IMAGE_NAME) + +# Stop the Docker container +stop: + docker stop $(CONTAINER_NAME) + +# Remove the Docker container +remove: + docker rm $(CONTAINER_NAME) + +# Clean up (stop and remove the container) +clean: stop remove + +# Rebuild the Docker image +rebuild: clean build \ No newline at end of file