mirror of https://github.com/omar-polo/gmid.git
contrib/Dockerfile: fix the build and improve the usage
Install a sample config, include a self-signed cert and setup a local user and chroot.
This commit is contained in:
parent
d8df67565c
commit
398253f3f5
|
@ -2,8 +2,10 @@
|
|||
!*.c
|
||||
!*.h
|
||||
!*.y
|
||||
!compat/*.c
|
||||
!compat/*.h
|
||||
!*.[1-9]
|
||||
!compat
|
||||
!have/*.c
|
||||
!Makefile
|
||||
!configure
|
||||
!contrib/Docker.gmid.conf
|
||||
!contrib/gencert
|
||||
|
|
|
@ -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 "/"
|
||||
}
|
|
@ -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
|
||||
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"]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
DISTFILES = Makefile \
|
||||
Docker.gmid.conf \
|
||||
Dockerfile \
|
||||
README \
|
||||
gencert \
|
||||
|
|
Loading…
Reference in New Issue