diff --git a/.dockerignore b/.dockerignore index f25eda7..42e3e2c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,8 +2,10 @@ !*.c !*.h !*.y -!compat/*.c -!compat/*.h +!*.[1-9] +!compat !have/*.c !Makefile !configure +!contrib/Docker.gmid.conf +!contrib/gencert diff --git a/contrib/Docker.gmid.conf b/contrib/Docker.gmid.conf new file mode 100644 index 0000000..5a0e429 --- /dev/null +++ b/contrib/Docker.gmid.conf @@ -0,0 +1,9 @@ +user gmid +chroot "/var/gemini" + +server "localhost" { + listen on * port 1965 + cert "/etc/ssl/localhost.pem" + key "/etc/ssl/private/localhost.key" + root "/" +} diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 9d6a29d..94a4573 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine as builder +FROM alpine WORKDIR /build RUN apk update && \ apk upgrade && \ @@ -6,14 +6,14 @@ RUN apk update && \ alpine-sdk \ linux-headers \ bison \ - libretls-dev \ - libretls-static \ - libevent-dev \ - libevent-static + libevent-dev \ + openssl-dev COPY . . -RUN make static - -FROM alpine -RUN apk update && apk upgrade -COPY --from=builder /build/gmid /bin/gmid -ENTRYPOINT ["gmid"] +RUN ./configure && make && make install +RUN adduser -H -S -s /sbin/nologin gmid +RUN mkdir /var/gemini +RUN ./contrib/gencert -e localhost && \ + mv localhost.pem /etc/ssl && \ + mv localhost.key /etc/ssl/private +RUN mv contrib/Docker.gmid.conf /etc/gmid.conf +ENTRYPOINT ["gmid", "-f"] diff --git a/contrib/Makefile b/contrib/Makefile index 8f81468..d6d7d45 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -1,4 +1,5 @@ DISTFILES = Makefile \ + Docker.gmid.conf \ Dockerfile \ README \ gencert \