diff --git a/.envrc b/.envrc index 4a4a1ba..61078d4 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,3 @@ -export TAILSCALESD_ENV_FILE=./.env +export TAILSCALESD_ENV_FILE=./dev.env use nix +dotenv diff --git a/.gitignore b/.gitignore index 6a70567..ffc8ec1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ tmp/ build htmlcov .direnv/ -.env +*.env diff --git a/Makefile b/Makefile index f273f5d..d9c6c9a 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,10 @@ SRC := tailscalesd TESTS := tests SHELL := $(shell which bash) APP_VERSION := $(shell git rev-parse --short HEAD) +DOCKER ?= docker docker-build: - DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile \ + DOCKER_BUILDKIT=1 $(DOCKER) build -f docker/Dockerfile \ --build-arg=$(APP_VERSION) \ -t tailscalesd:latest \ . diff --git a/docker/Dockerfile b/docker/Dockerfile index 5378847..e5a0f75 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,10 +25,9 @@ USER ${APP} WORKDIR ${APP_BASE}/${APP} COPY --chown=${APP}:${APP} requirements.frozen.txt requirements.frozen.txt RUN pip3 install -r requirements.frozen.txt -COPY --chown=${APP}:${APP} gm gm +COPY --chown=${APP}:${APP} tailscalesd tailscalesd ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] -CMD /usr/bin/env python3 -m tailscalesd.main:main USER ${APP} ARG APP_VERSION -ENV APP_VERSION="${APP_VERSION}"% +ENV APP_VERSION="${APP_VERSION}" diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..9158b2d --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e; + +cd /srv/tailscalesd; +exec /usr/bin/env python3 -m tailscalesd.main:main "$@" diff --git a/pyproject.toml b/pyproject.toml index 0d9a0e6..6fabc7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [tool.poetry] name = "tailscalesd" version = "0.1.0" -description = "" +description = "Discover services to monitor with prometheus over tailscale" authors = ["Abel Luck "] include = ["LICENSE.MD"] exclude = ["tests"] readme = "README.md" -homepage = "https://gitlab.com/guardianproject-ops/py-tailscalesd" -repository = "https://gitlab.com/guardianproject-ops/py-tailscalesd" +homepage = "https://gitlab.com/guardianproject-ops/tailscalesd" +repository = "https://gitlab.com/guardianproject-ops/tailscalesd" packages = [ { include = "tailscalesd"} ]