From f77b10d3defb9a5077b95955ec3ea94fbeaff14a Mon Sep 17 00:00:00 2001 From: Pierre Dubouilh Date: Sun, 20 Oct 2019 15:25:15 +0200 Subject: [PATCH] last refactor --- gossa-ui | 2 +- support/Caddyfile | 4 ++-- support/build.Dockerfile | 4 ++-- support/caddy.Dockerfile | 4 +++- support/readme.md | 9 +++------ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/gossa-ui b/gossa-ui index 8849f5d..c30a324 160000 --- a/gossa-ui +++ b/gossa-ui @@ -1 +1 @@ -Subproject commit 8849f5d0d9111ba99aaf56550465f6f025816228 +Subproject commit c30a3240b528eb2d641211d75f376f099dd6ca47 diff --git a/support/Caddyfile b/support/Caddyfile index 1646770..588f78c 100644 --- a/support/Caddyfile +++ b/support/Caddyfile @@ -1,8 +1,8 @@ # Caddy config -# to enable https just set a valid/reachable domain instead of *:8002 - how simple ! +# to enable https just set a valid domain instead of mydomain.com - how simple ! # authentication has been setup with 2 users, alice and bob -*:8002 +mydomain.com basicauth / alice paul basicauth / bob dylan proxy / 127.0.0.1:8001 \ No newline at end of file diff --git a/support/build.Dockerfile b/support/build.Dockerfile index de6f990..43a4cbe 100644 --- a/support/build.Dockerfile +++ b/support/build.Dockerfile @@ -3,9 +3,9 @@ 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" +ENV UID="1000" GID="1000" HOST="0.0.0.0" PORT="8001" PREFIX="/" HISTORY="true" FOLLOW_SYMLINKS="false" SKIP_HIDDEN_FILES="true" DATADIR="/shared" EXPOSE 8001 RUN apk add --no-cache su-exec COPY --from=builder /gossaSrc/gossa /gossa -RUN echo -e 'exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} ${DATADIR}'>> /start.sh +RUN echo -e 'exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} --history=${HISTORY} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} ${DATADIR}'>> /start.sh ENTRYPOINT [ "sh", "/start.sh" ] diff --git a/support/caddy.Dockerfile b/support/caddy.Dockerfile index 238851b..b558102 100644 --- a/support/caddy.Dockerfile +++ b/support/caddy.Dockerfile @@ -7,5 +7,7 @@ RUN tar xvzf caddy.tar.gz && mv caddy /caddy COPY Caddyfile / -RUN echo -e '/gossa -h 127.0.0.1 /shared & \n /caddy'>> /start.sh +ENV UID="1000" GID="1000" HOST="127.0.0.1" PORT="8001" PREFIX="/" HISTORY="true" FOLLOW_SYMLINKS="false" SKIP_HIDDEN_FILES="true" DATADIR="/shared" +EXPOSE 443 +RUN echo -e 'exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} --history=${HISTORY} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} ${DATADIR} & \n /caddy'>> /start.sh ENTRYPOINT [ "sh", "/start.sh" ] diff --git a/support/readme.md b/support/readme.md index d77bbb3..0ebad1b 100644 --- a/support/readme.md +++ b/support/readme.md @@ -8,10 +8,8 @@ the master branch is automatically built and pushed to [dockerhub](https://hub.d if you prefer building the image yourself : ```sh -# build gossa within a build container, needs to be ran within the sources, ../ from here +# build gossa within a build container, needs to be ran within the sources, ../ from here, and run % docker build -t gossa -f support/build.Dockerfile . - -# and to run it simply % sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 gossa ``` @@ -20,10 +18,9 @@ the options are settable through environment variables that can be passed starti a fancy docker image using [Caddy](https://caddyserver.com/) is also provided. a simple config is embedded in the docker file, and shows how to use http basic authentication, and automatic TLS for hands-free https 🎉 ```sh -# run with caddy, checkout the config in the dockerfile +# checkout the caddy config, build, and run docker image +% vim caddy.Dockerfile % docker build -t gossa-caddy -f caddy.Dockerfile . - -# run with caddy % sudo docker run -v ~/LocalDirToShare:/shared --net=host gossa-caddy ```