Mercurial > p > roundup > code
diff scripts/Docker/Dockerfile @ 6797:a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
The docker healthcheck was hardcoded to check the /issues/ tracker.
Replace healthcheck with one that looks for the tracker names on the
roundup-server command line and checks the first one.
During build, additional modules can be specified using
--build-arg="pip_mod=requests setproctitle". This lets the user add
modules unique to the tracker without having to 'docker commit' a new
image from a running container.
Use --build-arg="roundup_uid=2000" to change the uid roundup runs
as. The default is 1000. This is done at build time, not run time.
Remove the sphinx package. All the dependent packages were removed
before, but sphinx wasn't. This led to spurious warnings fom the pip
dependency resolver.
Update docs with changes.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 21 Jul 2022 00:54:52 -0400 |
| parents | 2eadad009010 |
| children | 4336e655b2be |
line wrap: on
line diff
--- a/scripts/Docker/Dockerfile Tue Jul 19 22:53:35 2022 -0400 +++ b/scripts/Docker/Dockerfile Thu Jul 21 00:54:52 2022 -0400 @@ -56,6 +56,7 @@ pip --no-cache-dir install sphinx && \ ./configure --prefix=/usr/local --with-python3 --disable-documentation && \ make && make install && \ + pip uninstall --no-cache-dir -y sphinx && \ pip uninstall --no-cache-dir -y -r $CWD/sphinxdeps.txt # add requirements for pip here, e.g. Whoosh, gpg, zstd or other @@ -64,6 +65,10 @@ COPY scripts/Docker/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# Allow user to add more modules during build +ARG pip_mod +RUN if [ -n "$pip_mod" ]; then pip install --no-cache-dir ${pip_mod}; fi + # copy the elements of the release directory to the docker image COPY setup.py install/ COPY doc install/doc/ @@ -118,19 +123,21 @@ COPY --from=build /usr/local/bin/roundup* /usr/local/bin/ COPY --from=build /usr/local/share /usr/local/share/ COPY scripts/Docker/roundup_start . +COPY scripts/Docker/roundup_healthcheck . + +# make roundup scripts execuable and mount a trackerdir on tracker location +RUN chmod +x roundup_start roundup_healthcheck; mkdir tracker +VOLUME $appdir/tracker # map port 8080 to your local port EXPOSE 8080/tcp -# mount a trackerdir on tracker location -RUN mkdir tracker -VOLUME $appdir/tracker - HEALTHCHECK --start-period=1m \ - CMD wget -q -O /dev/null --no-verbose http://localhost:8080/issues/ + CMD ./roundup_healthcheck # do not run roundup as root. This creates roundup user and group. -RUN adduser -D -h /usr/src/app roundup +ARG roundup_uid +RUN adduser -D -h ${appdir} -u ${roundup_uid:-1000} roundup USER roundup # run the server, disable output buffering so we can see logs.
