No Description

Dockerfile 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # IRIS Source Code
  2. # Copyright (C) 2021 - Airbus CyberSecurity (SAS)
  3. # ir@cyberactionlab.net
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Lesser General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 3 of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Lesser General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Lesser General Public License
  16. # along with this program; if not, write to the Free Software Foundation,
  17. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. ####################
  19. # COMPILE JS IMAGE #
  20. ####################
  21. FROM node:20-alpine AS compile-js-image
  22. COPY ui/ /ui
  23. RUN rm -rf /ui/{node_modules,dist}
  24. WORKDIR /ui
  25. RUN npm ci
  26. RUN npm run build
  27. #################
  28. # COMPILE IMAGE #
  29. #################
  30. FROM python:3.12 AS compile-image
  31. RUN apt-get update
  32. RUN python -m venv /opt/venv
  33. # Make sure we use the virtualenv:
  34. ENV PATH="/opt/venv/bin:$PATH"
  35. COPY source/dependencies /dependencies
  36. COPY source/requirements.txt /
  37. RUN pip3 install -r requirements.txt
  38. ###############
  39. # BUILD IMAGE #
  40. ###############
  41. FROM python:3.12 AS iriswebapp
  42. ENV PYTHONUNBUFFERED=1 DOCKERIZED=1
  43. COPY --from=compile-image /opt/venv /opt/venv
  44. # Make sure we use the virtualenv:
  45. ENV PATH="/opt/venv/bin:$PATH"
  46. # Define specific admin password at creation
  47. #ENV IRIS_ADM_PASSWORD="MySuperFirstPasswordIWant"
  48. RUN apt update
  49. RUN apt install -y p7zip-full pgp rsync postgresql-client
  50. RUN mkdir /iriswebapp/
  51. RUN mkdir -p /home/iris/certificates/{rootCA,web_certificates}
  52. RUN mkdir -p /home/iris/user_templates
  53. RUN mkdir -p /home/iris/server_data
  54. RUN mkdir -p /home/iris/server_data/backup
  55. RUN mkdir -p /home/iris/server_data/updates
  56. RUN mkdir -p /home/iris/server_data/custom_assets
  57. RUN mkdir -p /home/iris/server_data/datastore
  58. WORKDIR /iriswebapp
  59. COPY docker/webApp/iris-entrypoint.sh .
  60. COPY docker/webApp/wait-for-iriswebapp.sh .
  61. COPY ./source .
  62. COPY --from=compile-js-image /ui/dist/ /iriswebapp/static/
  63. # Add execution right to binaries needed by evtx2splunk for iris_evtx module
  64. RUN chmod +x /iriswebapp/dependencies/evtxdump_binaries/linux/x64/fd
  65. RUN chmod +x /iriswebapp/dependencies/evtxdump_binaries/linux/x64/evtx_dump
  66. RUN chmod +x iris-entrypoint.sh
  67. RUN chmod +x wait-for-iriswebapp.sh
  68. #ENTRYPOINT [ "./iris-entrypoint.sh" ]