complement/cmd/homerunner/Dockerfile
Michael Kaye 91a35bc177
Homerunner: Permit running HS with remote networking, and provide docker build (#560)
* A dockerfile for homerunner.

(also some gitignore changes because the directory cmd/homerunner/ was being ignored.

* Expose new environment variable to specify where docker should expose ports.

* Typo in Getenv.

* Work around lack of default in os.Getenv()

Co-authored-by: kegsay <kegan@matrix.org>
2022-11-29 20:36:17 +00:00

34 lines
1.1 KiB
Docker

# This dockerfile simply holds `homerunner` when run in a containerized env.
# see matrix-org/complement/dockerfiles for links to the complement
# images that are used in tests.
# NB: building needs to be done from the root of the complement directory, ie
# `~/work/complement> docker build -t cmd/homerunner/Dockerfile . `
# to ensure the whole project is passed to the docker container to build.
# Build
FROM golang:1.19-buster
RUN echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/complement.list
RUN apt-get update && apt-get install -y libolm3 libolm-dev/buster-backports
WORKDIR /app
COPY . /app
RUN go build ./cmd/homerunner
# Executable
FROM debian:buster
RUN echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/complement.list
RUN apt-get update && apt-get install -y libolm3 && apt-get clean
COPY --from=0 /app/homerunner /usr/local/bin/homerunner
HEALTHCHECK --interval=1m --timeout=5s \
CMD curl -f http://localhost:54321/ || exit 1
EXPOSE 54321/tcp
ENTRYPOINT ["/usr/local/bin/homerunner"]