Skip to content

Add Dockerfile and entrypoint for container deployment#41

Merged
Bekkie merged 2 commits intoAmpScm:mainfrom
john-johansson:feature/containerization
Mar 5, 2026
Merged

Add Dockerfile and entrypoint for container deployment#41
Bekkie merged 2 commits intoAmpScm:mainfrom
john-johansson:feature/containerization

Conversation

@rh-john
Copy link

@rh-john rh-john commented Mar 2, 2026

Summary

  • Add a minimal Dockerfile (python:3.12-slim, non-root, multi-arch) and entrypoint.sh with env-var-driven configuration, persistent pairing DB via /data volume, and forward-compatible accessory support for PR Add standalone HomeKit accessory support (e.g. Smart AC Control V3+) #40
  • Add .dockerignore to keep images lean
  • Update INSTALLATION.md with "Method 4: Container (Docker/Podman)" section covering build, first-time pairing, subsequent runs, and environment variables; remove "Add Docker support" from Future Work

Details

The entrypoint handles three scenarios:

  1. No bridge IP and no pairing DB — sleeps with a helpful message
  2. First-time pairing — requires TADO_BRIDGE_IP and TADO_BRIDGE_PIN
  3. Subsequent runs — only TADO_BRIDGE_IP needed (pairing DB persisted in volume)

Uses exec to replace the shell so signals propagate correctly to the tado-local process.

Relates to #6
Relates to #12

Test plan

  • docker build -t tado-local . succeeds on AMD64
  • podman build -t tado-local . succeeds on ARM64
  • Container starts and sleeps when no TADO_BRIDGE_IP is set
  • Container starts and pairs when bridge IP and PIN are provided
  • Pairing DB persists across container restarts via /data volume
  • Container runs as non-root (UID 1000)

Provides an official container option using python:3.12-slim with local
source install, non-root user, persistent /data volume, and env-driven
configuration. Includes forward-compatible accessory support (PR AmpScm#40).
Add Method 4 (Docker/Podman) section with build, pairing, and
environment variable docs. Remove "Add Docker support" from future work.
@Bekkie
Copy link
Collaborator

Bekkie commented Mar 5, 2026

Looks good to me, after merging #40 will merge this one.

@rhuijben
Copy link
Member

rhuijben commented Mar 5, 2026

Thanks!

@SanderNijdam
Copy link

Will this become available on Docker Hub? That would make installing it on a NAS a lot simpler.

@Bekkie Bekkie merged commit e728477 into AmpScm:main Mar 5, 2026
5 checks passed
@Bekkie
Copy link
Collaborator

Bekkie commented Mar 5, 2026

Will this become available on Docker Hub? That would make installing it on a NAS a lot simpler.

I do not have experience in pushing an image to Docker Hub @rhuijben or @rh-john do you?

@SanderNijdam
Copy link

There already seems to be a version of tadolocal on Docker Hub:
https://hub.docker.com/r/maartenmol/tadolocal
However, I cannot get this to work as there is no documentation on the variable names and therefore it cannot find the PIN.

@rh-john rh-john deleted the feature/containerization branch March 8, 2026 13:17
@john-johansson
Copy link
Contributor

john-johansson commented Mar 8, 2026

I added build and push CI to my fork. So whenever I update it, you'll find hosted images at quay.io/john_johansson/tadlocal - I will keep this public until this project implement its own official registry.

You can pull either latest, a specific version or a branch:

docker pull quay.io/john_johansson/tadlocal:latest
docker pull quay.io/john_johansson/tadlocal:1.1.1
docker pull quay.io/john_johansson/tadlocal:main

@SanderNijdam
Copy link

Thanks!
I managed to install it on my Synology NAS. However, when running it I get these errors and then it shuts down immediately:
ERROR Database migration check failed: unable to open database file
ERROR ERROR: Failed to start Tado Local: unable to open database file

@john-johansson
Copy link
Contributor

Most likely due to the fact that the container is running with a unprivliged UID and not as root. To accomdate for this, you'd have to modify the Dockerfile and build your own container image.

FROM python:3.12-slim

RUN apt-get update \
    && apt-get install -y --no-install-recommends libdbus-1-3 \
    && rm -rf /var/lib/apt/lists/*

COPY . /app
RUN pip install --no-cache-dir /app \
    && chmod +x /app/entrypoint.sh

VOLUME /data
EXPOSE 4407

ENTRYPOINT ["/app/entrypoint.sh"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants