Mercurial > p > roundup > code
annotate scripts/Docker/Dockerfile @ 7643:fae314043555
build(docker): disable pip_sdist mode
in github ci:
COPY README.txt dist/* install/dist/
crashes the docker build if the dist directory is missing. This
prevents anchore/grype from scanning the image.
This is a new issue as it doesn't happen on my system. The README.txt
file is there explicitly to prevent COPY from failing if nothing
matches the wildcard. This used to work, but ....
So I am disabling building from local sdist.
This only affects maintainers. Building from sdist is done to generate
a docker that matches a source distribution that has yet to be uploaded
to pypi.
Other use cases can build using the default of local.
I haven't found a way to make a dist subdir in the docker build
context directory. I can't even figure out how to identify the context
directory name inside the build container.
Also updated installation docs.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 24 Sep 2023 22:24:51 -0400 |
| parents | 0b03b4dd7089 |
| children | d5166fdcffa6 |
| rev | line source |
|---|---|
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
1 # hadolint global ignore=DL3003 |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
2 # build in root dir using: |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
3 # |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
4 # docker build -t roundup-app --rm -f scripts/Dockerfile . |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
5 # |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
6 # run using: |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
7 # |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
8 # docker run --rm -v /.../issue.tracker:/usr/src/app/tracker \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
9 # -p 9017:8080 roundup-app:latest |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
10 |
|
7640
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
11 # arguments expected to be useful on command line. Lower case names. |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
12 |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
13 # Source of roundup code: |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
14 # 'local' directory using setup.py, |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
15 # 'pypi[...]' to install latest final or version specified release |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
16 # from PyPI, E.G. pypi=2.4; pypi<2.3 etc. All pip version specifiers |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
17 # are allowed. |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
18 # 'pip_local' local directory using pip to install, or |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
19 # 'pip_sdist' to install dist/newest_version-tarball |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
20 ARG source=local |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
21 |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
22 # Internal settings that are for advanced users to override. |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
23 |
|
7637
d745a6eb0604
build: update python:3-alpine version
John Rouillard <rouilj@ieee.org>
parents:
7634
diff
changeset
|
24 # parameterize the sha256 sum to pin version of python:3-alpine |
|
7640
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
25 # Must use the same version in both build stages. |
|
7637
d745a6eb0604
build: update python:3-alpine version
John Rouillard <rouilj@ieee.org>
parents:
7634
diff
changeset
|
26 ARG SHA256=5d769f990397afbb2aca24b0655e404c0f2806d268f454b052e81e39d87abf42 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
27 |
|
7640
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
28 # Set to any non-empy value to enable shell debugging for troubleshooting |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
29 ARG VERBOSE= |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
30 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
31 # application directory |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
32 ARG appdir=/usr/src/app |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
33 |
|
7640
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
34 # Python version as a.b Used as path component for |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
35 # installation directory and COPY from install dir |
|
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
36 # in second build stage. |
|
7042
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
37 ARG pythonversion=3.11 |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
38 |
|
7637
d745a6eb0604
build: update python:3-alpine version
John Rouillard <rouilj@ieee.org>
parents:
7634
diff
changeset
|
39 #FROM python:3-alpine via SHA256 sum |
|
d745a6eb0604
build: update python:3-alpine version
John Rouillard <rouilj@ieee.org>
parents:
7634
diff
changeset
|
40 FROM python@sha256:$SHA256 as build |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
41 |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
42 # Inherit global values https://github.com/moby/moby/issues/37345 |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
43 ARG appdir |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
44 |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
45 WORKDIR $appdir |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
46 |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
47 # Update to get security and other improvements; |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
48 RUN apk --no-cache upgrade |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
49 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
50 # Add packages needed to compile mysql, pgsql and other python modules. |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
51 # Can't use apk to add python packages as it installs 3.9 python version. |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
52 # g++ installs cc1plus needed by pip install |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
53 RUN apk --no-cache add \ |
|
7642
0b03b4dd7089
build(docker): add file package to clear error when building xapian
John Rouillard <rouilj@ieee.org>
parents:
7640
diff
changeset
|
54 file \ |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
55 g++ \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
56 gcc \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
57 gpgme-dev \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
58 libxapian \ |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
59 linux-headers \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
60 make \ |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
61 musl-dev \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
62 mysql-dev \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
63 postgresql-dev \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
64 swig \ |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
65 xapian-core-dev |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
66 |
|
7042
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
67 ARG pythonversion |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
68 # verify that pythonversion matches the one in the image. |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
69 RUN image_python_version=$(python -c 'import sys; print("%s.%s"%sys.version_info[0:2])'); \ |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
70 if [ "${pythonversion}" != "${image_python_version}" ]; then \ |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
71 printf "\n\n*****\npythonversion does not match.\n" ; \ |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
72 printf "Add:\n --build-arg=\"pythonversion=%s\"\nto docker build\n******\n\n" "${image_python_version}"; \ |
|
7042
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
73 exit 1; \ |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
74 fi |
|
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
75 |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
76 # build xapian bindings: |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
77 # file with sphinx build dependencies to remove after build |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
78 # they are over 70MB of space. |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
79 COPY scripts/Docker/sphinxdeps.txt . |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
80 |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
81 # suppress warning when running pip as root |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
82 ENV PIP_ROOT_USER_ACTION=ignore |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
83 |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
84 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
85 ARG VERBOSE |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
86 |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
87 RUN [ -z "${VERBOSE}" ] || set -xv; \ |
| 7634 | 88 CWD="$PWD" && \ |
|
7119
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
89 upgrades=$(python3 -m pip --no-cache --disable-pip-version-check \ |
|
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
90 list --outdated | awk 'NR > 2 {print $1}'); \ |
|
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
91 if [ -n "$upgrades" ]; then \ |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
92 echo "Pip updating $upgrades"; \ |
|
7119
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
93 python -m pip --no-cache --disable-pip-version-check \ |
|
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
94 install -U $upgrades < /dev/null; \ |
|
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
95 else \ |
| 7634 | 96 echo "Nothing to pip update"; \ |
|
7119
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
97 fi; \ |
|
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
98 ls -l /usr/local/lib/python3.11/site-packages; \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
99 VER=$(apk list -I 'xapian-core-dev' | \ |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
100 sed 's/^xapian-core-dev-\([0-9.]*\)-.*/\1/') && \ |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
101 cd /tmp && \ |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
102 wget -q "https://oligarchy.co.uk/xapian/$VER/xapian-bindings-$VER.tar.xz" && \ |
|
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
103 tar -Jxvf "xapian-bindings-$VER.tar.xz" && \ |
| 7634 | 104 cd "xapian-bindings-$VER/" && \ |
|
6686
2eadad009010
Remove sphinx 1.8.5 limit. Use current pipy version.
John Rouillard <rouilj@ieee.org>
parents:
6575
diff
changeset
|
105 pip --no-cache-dir install sphinx && \ |
|
7040
60ea33643a01
Anchore Container Scan docker bulld is failing.
John Rouillard <rouilj@ieee.org>
parents:
6994
diff
changeset
|
106 sed -i -e '/PYTHON3_SO=/s/distutils\.//g' \ |
|
7639
b9641ea5fee4
build: make Dockerfile work for 3.12 release
John Rouillard <rouilj@ieee.org>
parents:
7637
diff
changeset
|
107 -e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' \ |
|
b9641ea5fee4
build: make Dockerfile work for 3.12 release
John Rouillard <rouilj@ieee.org>
parents:
7637
diff
changeset
|
108 -e '/PYTHON3_CACHE_TAG=/s/imp;print(imp.get_tag())/sys;print(sys.implementation.cache_tag)/' \ |
|
b9641ea5fee4
build: make Dockerfile work for 3.12 release
John Rouillard <rouilj@ieee.org>
parents:
7637
diff
changeset
|
109 -e '/PYTHON3_CACHE_OPT1_EXT=/s/imp\.get_tag()/sys.implementation.cache_tag/g' \ |
|
b9641ea5fee4
build: make Dockerfile work for 3.12 release
John Rouillard <rouilj@ieee.org>
parents:
7637
diff
changeset
|
110 -e '/PYTHON3_CACHE_OPT1_EXT=/s/imp\b/importlib/g' \ |
|
b9641ea5fee4
build: make Dockerfile work for 3.12 release
John Rouillard <rouilj@ieee.org>
parents:
7637
diff
changeset
|
111 configure && \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
112 ./configure --prefix=/usr/local --with-python3 --disable-documentation && \ |
|
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
113 make && make install && \ |
|
6797
a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
John Rouillard <rouilj@ieee.org>
parents:
6686
diff
changeset
|
114 pip uninstall --no-cache-dir -y sphinx && \ |
| 7634 | 115 pip uninstall --no-cache-dir -y -r "$CWD/sphinxdeps.txt" && \ |
|
7604
d117ddcb0ed1
Update dockerfile build: new python base image, reduce disk space use
John Rouillard <rouilj@ieee.org>
parents:
7530
diff
changeset
|
116 rm -rf /usr/local/share/doc/xapian-bindings |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
117 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
118 # add requirements for pip here, e.g. Whoosh, gpg, zstd or other |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
119 # modules not installed in the base library. |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
120 # ignore warnings from pip to use virtualenv |
|
6555
34cbd0e633d2
Added FastCGI deployment info, updated Docker docs; docker-compose added
John Rouillard <rouilj@ieee.org>
parents:
6530
diff
changeset
|
121 COPY scripts/Docker/requirements.txt . |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
122 RUN pip install --no-cache-dir -r requirements.txt |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
123 |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
124 # copy the elements of the release directory to the docker image |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
125 COPY setup.py install/ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
126 COPY doc install/doc/ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
127 COPY frontends install/frontends/ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
128 COPY locale install/locale/ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
129 COPY roundup install/roundup/ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
130 COPY share install/share/ |
|
7640
cea108761b8c
fix,docs: Move args around into groups; add docs.
John Rouillard <rouilj@ieee.org>
parents:
7639
diff
changeset
|
131 # dist/* might not exist, so include README.txt so we don't get an error |
|
7643
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
132 #COPY README.txt dist/* install/dist/ |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
133 |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
134 # verify source has one of two valid values then |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
135 # install in python3 standard directories from local copy |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
136 # or install in python3 standard directories from pypi using pip |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
137 # import from global/command line |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
138 ARG source |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
139 |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
140 RUN [ -z "${VERBOSE}" ] || set -xv; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
141 case "$source" in \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
142 "local") \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
143 cd install && ./setup.py install;; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
144 "pypi"*) \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
145 version_spec=$( printf "%s" "$source" | \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
146 sed -ne 's/^pypi\([~=!<>].*\)/\1/p'); \ |
| 7634 | 147 pip install --no-cache-dir "roundup${version_spec}"; \ |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
148 cp -ril /usr/local/lib/"python${pythonversion}"/site-packages/usr/local/share/* \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
149 /usr/local/share;; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
150 "pip_local") \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
151 cd install && \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
152 pip -V && \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
153 pip install --no-cache-dir . ;; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
154 "pip_sdist") \ |
|
7643
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
155 printf "\n\npip_sdist disabled\n\n" && exit 1 ; \ |
| 7634 | 156 dist=$(find install/dist | sed -ne '/roundup-[0-9].*\.tar\.gz$/p' | tail -n 1); \ |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
157 if [ -z "$dist" ] ; then \ |
|
7643
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
158 printf "\n\nUnable to find a source distribution file in dist\n"; \ |
|
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
159 printf "Exiting\n\n"; \ |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
160 exit 1; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
161 fi; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
162 printf "Building with distribution: %s\n" "$dist"; \ |
| 7634 | 163 pip install --no-cache-dir "install/dist/$dist";; \ |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
164 *) \ |
|
7643
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
165 printf "\n\ninvalid value for source: $source\n"; \ |
|
fae314043555
build(docker): disable pip_sdist mode
John Rouillard <rouilj@ieee.org>
parents:
7642
diff
changeset
|
166 printf "must be local, pypi, pip_local or pip_sdist\n\n"; \ |
|
7441
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
167 exit 1;; \ |
|
e7df82ae137d
Cleanup docker before 2.3.0b1 release
John Rouillard <rouilj@ieee.org>
parents:
7330
diff
changeset
|
168 esac |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
169 |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
170 # Allow user to add more modules during build |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
171 ARG pip_mod |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
172 RUN if [ -n "$pip_mod" ]; then pip install --no-cache-dir ${pip_mod}; fi |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
173 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
174 # build a new smaller docker image for execution. Build image above |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
175 # is 1G in size. |
|
7149
282ba72a5615
pin python image versions using sha256 sum
John Rouillard <rouilj@ieee.org>
parents:
7119
diff
changeset
|
176 # FROM python:3-alpine |
|
7637
d745a6eb0604
build: update python:3-alpine version
John Rouillard <rouilj@ieee.org>
parents:
7634
diff
changeset
|
177 FROM python@sha256:$SHA256 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
178 |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
179 # import from global |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
180 ARG appdir |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
181 |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
182 WORKDIR $appdir |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
183 |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
184 # suppress warning when running pip as root |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
185 ENV PIP_ROOT_USER_ACTION=ignore |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
186 |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
187 # upgrade to get any security updates; bundle with |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
188 # rest of apk actions to reduce layers/wasted space |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
189 # add libraries needed to run gpg/mysql/pgsql/brotli |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
190 # clean out any caches to save space |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
191 # upgrade pip packages to get security and other updates |
|
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
192 # bundle with apk updates |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
193 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] |
|
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
194 RUN apk --no-cache upgrade; \ |
|
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
195 apk --no-cache add \ |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
196 brotli-libs \ |
|
7308
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
197 dumb-init \ |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
198 gpgme \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
199 mariadb-connector-c \ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
200 libpq \ |
|
6575
c3c636feace3
Ass support for xapian indexer.
John Rouillard <rouilj@ieee.org>
parents:
6566
diff
changeset
|
201 libstdc++ \ |
|
6994
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
202 libxapian \ |
|
4336e655b2be
Update packages in docker image; supress pip warning; improve cache
John Rouillard <rouilj@ieee.org>
parents:
6797
diff
changeset
|
203 zstd-libs; \ |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
204 upgrades=$(python3 -m pip --no-cache --disable-pip-version-check \ |
|
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
205 list --outdated | awk 'NR > 2 {print $1}'); \ |
|
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
206 if [ -n "$upgrades" ]; then \ |
|
7237
f636acd7d63c
hadolint fixes/best practices added
John Rouillard <rouilj@ieee.org>
parents:
7149
diff
changeset
|
207 echo "Pip updating $upgrades"; \ |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
208 python -m pip --no-cache --disable-pip-version-check \ |
|
7119
59908110ccc9
More changes to remove stragglers of old setuptools.
John Rouillard <rouilj@ieee.org>
parents:
7117
diff
changeset
|
209 install -U $upgrades < /dev/null; \ |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
210 else \ |
| 7634 | 211 echo "Nothing to pip update"; \ |
|
7117
9f3ca362a415
pip update outdated packages
John Rouillard <rouilj@ieee.org>
parents:
7042
diff
changeset
|
212 fi |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
213 |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
214 ARG source |
|
7517
207a7eca41ed
Add labels for ARGS that can change as part of build.
John Rouillard <rouilj@ieee.org>
parents:
7496
diff
changeset
|
215 ARG pythonversion |
|
207a7eca41ed
Add labels for ARGS that can change as part of build.
John Rouillard <rouilj@ieee.org>
parents:
7496
diff
changeset
|
216 ARG pip_mod |
|
7495
12674129a45c
Dockerfile label updates, change version string in RELEASE.txt
John Rouillard <rouilj@ieee.org>
parents:
7491
diff
changeset
|
217 LABEL "org.opencontainers.image.vendor"="Roundup Issue Tracker Team" \ |
|
12674129a45c
Dockerfile label updates, change version string in RELEASE.txt
John Rouillard <rouilj@ieee.org>
parents:
7491
diff
changeset
|
218 "org.opencontainers.image.title"="Roundup Issue Tracker" \ |
|
7517
207a7eca41ed
Add labels for ARGS that can change as part of build.
John Rouillard <rouilj@ieee.org>
parents:
7496
diff
changeset
|
219 "org.opencontainers.image.description"="Roundup Issue Tracker with multi-backend support installed via $source with python version $pythonversion" \ |
|
7530
ed2bc951277b
Updates for 2.3.0 release.
John Rouillard <rouilj@ieee.org>
parents:
7517
diff
changeset
|
220 "org.opencontainers.image.version"="2.3.0" \ |
|
7495
12674129a45c
Dockerfile label updates, change version string in RELEASE.txt
John Rouillard <rouilj@ieee.org>
parents:
7491
diff
changeset
|
221 "org.opencontainers.image.authors"="roundup-devel@lists.sourceforge.net" \ |
|
7496
ec738682874d
Fix missing escaped newline.
John Rouillard <rouilj@ieee.org>
parents:
7495
diff
changeset
|
222 "org.opencontainers.image.licenses"="MIT AND ZPL-2.0 AND Python-2.0" \ |
|
7517
207a7eca41ed
Add labels for ARGS that can change as part of build.
John Rouillard <rouilj@ieee.org>
parents:
7496
diff
changeset
|
223 "org.opencontainers.image.documentation"="https://www.roundup-tracker.org/docs/installation.html" \ |
|
207a7eca41ed
Add labels for ARGS that can change as part of build.
John Rouillard <rouilj@ieee.org>
parents:
7496
diff
changeset
|
224 "pip-modules"="$pip_mod" |
|
7495
12674129a45c
Dockerfile label updates, change version string in RELEASE.txt
John Rouillard <rouilj@ieee.org>
parents:
7491
diff
changeset
|
225 |
|
6566
8f1fddb71422
Add maintainer address (via label) to rounduo-devel list.
John Rouillard <rouilj@ieee.org>
parents:
6555
diff
changeset
|
226 |
|
7042
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
227 ARG pythonversion |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
228 # pull over built assets |
|
7042
031cdb92fa1d
Replace hardcoded python version with ARG variable
John Rouillard <rouilj@ieee.org>
parents:
7041
diff
changeset
|
229 COPY --from=build /usr/local/lib/python${pythonversion}/site-packages /usr/local/lib/python${pythonversion}/site-packages/ |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
230 COPY --from=build /usr/local/bin/roundup* /usr/local/bin/ |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
231 COPY --from=build /usr/local/share /usr/local/share/ |
|
7604
d117ddcb0ed1
Update dockerfile build: new python base image, reduce disk space use
John Rouillard <rouilj@ieee.org>
parents:
7530
diff
changeset
|
232 COPY scripts/Docker/roundup_start scripts/Docker/roundup_healthcheck ./ |
|
6797
a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
John Rouillard <rouilj@ieee.org>
parents:
6686
diff
changeset
|
233 |
|
7308
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
234 # Do not run roundup as root. This creates roundup user and group. |
|
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
235 ARG roundup_uid |
|
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
236 RUN adduser -D -h ${appdir} -u ${roundup_uid:-1000} roundup |
|
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
237 |
|
6797
a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
John Rouillard <rouilj@ieee.org>
parents:
6686
diff
changeset
|
238 # make roundup scripts execuable and mount a trackerdir on tracker location |
|
7308
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
239 RUN chmod +x roundup_start roundup_healthcheck; \ |
|
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
240 mkdir tracker; chown ${roundup_uid:-1000}:${roundup_uid:-1000} tracker |
|
6797
a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
John Rouillard <rouilj@ieee.org>
parents:
6686
diff
changeset
|
241 VOLUME $appdir/tracker |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
242 |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
243 # map port 8080 to your local port |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
244 EXPOSE 8080/tcp |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
245 |
|
6530
6bf22b7b23fe
Add local_pip source and add healthcheck.
John Rouillard <rouilj@ieee.org>
parents:
6527
diff
changeset
|
246 HEALTHCHECK --start-period=1m \ |
|
6797
a24ec63759f6
Docker fix healthcheck; allow modules; cleanup; set uid
John Rouillard <rouilj@ieee.org>
parents:
6686
diff
changeset
|
247 CMD ./roundup_healthcheck |
|
6530
6bf22b7b23fe
Add local_pip source and add healthcheck.
John Rouillard <rouilj@ieee.org>
parents:
6527
diff
changeset
|
248 |
|
7308
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
249 # switch to using roundup user |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
250 USER roundup |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
251 |
|
6522
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
252 # run the server, disable output buffering so we can see logs. |
|
e6ae8188f61a
issue2551163 Docker/containerization support
John Rouillard <rouilj@ieee.org>
parents:
6520
diff
changeset
|
253 ENV PYTHONUNBUFFERED=1 |
|
6555
34cbd0e633d2
Added FastCGI deployment info, updated Docker docs; docker-compose added
John Rouillard <rouilj@ieee.org>
parents:
6530
diff
changeset
|
254 #ENTRYPOINT [ "roundup-server", "-n", "0.0.0.0" ] |
|
7308
24cbf3a41e8a
Use dumb-init in Dockerfile; chown tracker directory to proper uid
John Rouillard <rouilj@ieee.org>
parents:
7305
diff
changeset
|
255 ENTRYPOINT [ "/usr/bin/dumb-init", "./roundup_start" ] |
|
6520
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
256 |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
257 # allow the invoker to override cmd with multiple trackers |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
258 # in each subdirectory under $appdir/tracker. E.G. |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
259 # docker run .... \ |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
260 # issues=tracker/issues foo=tracker/foo |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
261 # |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
262 # note using "issue=$appdir/tracker" results in error: |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
263 # |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
264 # No valid configuration files found in directory /usr/src/app/$appdir/tracker |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
265 # |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
266 # so $appdir not expanded and $PWD prefixed onto the (relative path) |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
267 # $appdir/tracker. Hence use relative path for spec. |
|
26babdf85067
issue2551163 - add starter docker
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
268 CMD [ "issues=tracker" ] |
