Dockerfile updates (#77)

* Added VERB environment variable for enabling verbosity in the Docker container
* pin the versions for golang and alpine at their current latest
* move the entrypoint script to a separate file, removed EXPOSE command from Dockerfile
This commit is contained in:
Tim Eichholz 2022-04-01 06:51:26 -05:00 committed by GitHub
parent cd255a21f6
commit f1dc8280f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -1,11 +1,10 @@
FROM golang:latest as builder
FROM golang:1.18 as builder
COPY . /gossaSrc
RUN cd /gossaSrc && make
FROM alpine
ENV UID="1000" GID="1000" HOST="0.0.0.0" PORT="8001" PREFIX="/" FOLLOW_SYMLINKS="false" SKIP_HIDDEN_FILES="true" DATADIR="/shared" READONLY="false"
EXPOSE 8001
FROM alpine:3.15
ENV UID="1000" GID="1000" HOST="0.0.0.0" PORT="8001" PREFIX="/" FOLLOW_SYMLINKS="false" SKIP_HIDDEN_FILES="true" DATADIR="/shared" READONLY="false" VERB="false"
RUN apk add --no-cache su-exec
COPY ./support/entrypoint.sh /entrypoint.sh
COPY --from=builder /gossaSrc/gossa /gossa
RUN echo -e 'exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} -ro=${READONLY} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} ${DATADIR}'>> /start.sh
ENTRYPOINT [ "sh", "/start.sh" ]
ENTRYPOINT "/entrypoint.sh"

2
support/entrypoint.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} -ro=${READONLY} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} --verb=${VERB} ${DATADIR}