|
1 | | -############################################################################### |
2 | | -#---------------------------- IMPORT RUNTIME -----------------------------# |
3 | | -############################################################################### |
4 | | - |
5 | | -FROM codecompass:runtime as runtime |
6 | | - |
7 | | -############################################################################### |
8 | | -#------------------------ EXECUTABLE CONTAINER --------------------------# |
9 | | -############################################################################### |
10 | | - |
11 | | -FROM ubuntu:22.04 |
12 | | - |
13 | | -# tzdata package is installed implicitly in the following command. This package |
14 | | -# sets timezone interactively during the installation process. This environment |
15 | | -# variable prevents this interaction. |
16 | | -ARG DEBIAN_FRONTEND=noninteractive |
17 | | - |
18 | | -RUN set -x && apt-get update -qq \ |
19 | | - && apt-get install -qqy --no-install-recommends \ |
20 | | - llvm-15 \ |
21 | | - libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \ |
22 | | - libsqlite3-dev \ |
23 | | - postgresql-server-dev-14 \ |
24 | | - default-jre \ |
25 | | - libgit2-dev \ |
26 | | - libldap-2.5-0 \ |
27 | | - libssl3 \ |
28 | | - libgvc6 \ |
29 | | - libthrift-dev \ |
30 | | - libpq5 \ |
31 | | - # To switch user and exec command. |
32 | | - gosu \ |
33 | | - tini \ |
34 | | - curl ca-certificates gnupg \ |
35 | | - wget \ |
36 | | - gcc-11 g++-11 \ |
37 | | - && ln -s /usr/bin/gcc-11 /usr/bin/gcc \ |
38 | | - && ln -s /usr/bin/g++-11 /usr/bin/g++ \ |
39 | | - && apt-get clean \ |
40 | | - && rm -rf /var/lib/apt/lists/ \ |
41 | | - && set +x |
42 | | - |
43 | | -# Install NodeJS from NodeSource. |
44 | | -RUN mkdir -p /etc/apt/keyrings && \ |
45 | | - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ |
46 | | - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ |
47 | | - apt-get update -qq && \ |
48 | | - apt-get install -y nodejs && \ |
49 | | - apt-get clean && \ |
50 | | - rm -rf /var/lib/apt/lists/ |
51 | | - |
52 | | -# Copy ODB install directory. |
53 | | -COPY --from=runtime /opt/odb /opt/odb |
54 | | - |
55 | | -ARG CC_GID=960 |
56 | | -ARG CC_UID=960 |
57 | | - |
58 | | -ENV CC_GID ${CC_GID} |
59 | | -ENV CC_UID ${CC_UID} |
60 | | - |
61 | | -# Create user and group for CodeCompass. |
62 | | -RUN groupadd --system codecompass --gid ${CC_GID} && \ |
63 | | - useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass |
64 | | - |
65 | | -# Copy CodeCompass install directory. (Change permission of the CodeCompass package.) |
66 | | -# TODO: only the webserver's binaries should be included in this image. |
67 | | -COPY --from=runtime --chown=codecompass:codecompass /codecompass /codecompass |
68 | | - |
69 | | -ENV PATH="/codecompass/bin:/opt/odb/bin:$PATH" |
70 | | - |
71 | | -COPY --chown=codecompass:codecompass docker/web/entrypoint.sh /usr/local/bin/entrypoint.sh |
72 | | -RUN chmod a+x /usr/local/bin/entrypoint.sh |
73 | | - |
74 | | - |
75 | | -EXPOSE 8080 |
76 | | - |
77 | | -ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"] |
78 | | - |
79 | | -CMD ["sh", "-c", "node ../../webgui-new/scripts/patch-basepath.js && CodeCompass_webserver -w /workspace -p 8080"] |
80 | | - |
| 1 | +############################################################################### |
| 2 | +#---------------------------- IMPORT RUNTIME -----------------------------# |
| 3 | +############################################################################### |
| 4 | + |
| 5 | +FROM codecompass:runtime as runtime |
| 6 | + |
| 7 | +############################################################################### |
| 8 | +#------------------------ EXECUTABLE CONTAINER --------------------------# |
| 9 | +############################################################################### |
| 10 | + |
| 11 | +FROM ubuntu:22.04 |
| 12 | + |
| 13 | +# tzdata package is installed implicitly in the following command. This package |
| 14 | +# sets timezone interactively during the installation process. This environment |
| 15 | +# variable prevents this interaction. |
| 16 | +ARG DEBIAN_FRONTEND=noninteractive |
| 17 | + |
| 18 | +RUN set -x && apt-get update -qq \ |
| 19 | + && apt-get install -qqy --no-install-recommends \ |
| 20 | + llvm-15 \ |
| 21 | + libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \ |
| 22 | + libsqlite3-dev \ |
| 23 | + postgresql-server-dev-14 \ |
| 24 | + default-jre \ |
| 25 | + libgit2-dev \ |
| 26 | + libldap-2.5-0 \ |
| 27 | + libssl3 \ |
| 28 | + libgvc6 \ |
| 29 | + libthrift-dev \ |
| 30 | + libpq5 \ |
| 31 | + # To switch user and exec command. |
| 32 | + gosu \ |
| 33 | + tini \ |
| 34 | + curl ca-certificates gnupg \ |
| 35 | + wget \ |
| 36 | + gcc-11 g++-11 \ |
| 37 | + && ln -s /usr/bin/gcc-11 /usr/bin/gcc \ |
| 38 | + && ln -s /usr/bin/g++-11 /usr/bin/g++ \ |
| 39 | + && apt-get clean \ |
| 40 | + && rm -rf /var/lib/apt/lists/ \ |
| 41 | + && set +x |
| 42 | + |
| 43 | +# Install NodeJS from NodeSource. |
| 44 | +RUN mkdir -p /etc/apt/keyrings && \ |
| 45 | + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ |
| 46 | + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ |
| 47 | + apt-get update -qq && \ |
| 48 | + apt-get install -y nodejs && \ |
| 49 | + apt-get clean && \ |
| 50 | + rm -rf /var/lib/apt/lists/ |
| 51 | + |
| 52 | +# Copy ODB install directory. |
| 53 | +COPY --from=runtime /opt/odb /opt/odb |
| 54 | + |
| 55 | +ARG CC_GID=960 |
| 56 | +ARG CC_UID=960 |
| 57 | + |
| 58 | +ENV CC_GID ${CC_GID} |
| 59 | +ENV CC_UID ${CC_UID} |
| 60 | + |
| 61 | +# Create user and group for CodeCompass. |
| 62 | +RUN groupadd --system codecompass --gid ${CC_GID} && \ |
| 63 | + useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass |
| 64 | + |
| 65 | +# Copy CodeCompass install directory. (Change permission of the CodeCompass package.) |
| 66 | +# TODO: only the webserver's binaries should be included in this image. |
| 67 | +COPY --from=runtime --chown=codecompass:codecompass /codecompass /codecompass |
| 68 | + |
| 69 | +ENV PATH="/codecompass/bin:/opt/odb/bin:$PATH" |
| 70 | + |
| 71 | +COPY --chown=codecompass:codecompass docker/web/entrypoint.sh /usr/local/bin/entrypoint.sh |
| 72 | +RUN chmod a+x /usr/local/bin/entrypoint.sh |
| 73 | + |
| 74 | + |
| 75 | +EXPOSE 8080 |
| 76 | + |
| 77 | +ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"] |
| 78 | + |
| 79 | +CMD ["sh", "-c", "node ../../webgui-new/scripts/patch-basepath.js && CodeCompass_webserver -w /workspace -p 8080"] |
| 80 | + |
0 commit comments