Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
FROM ubuntu:latest
MAINTAINER Shamal Faily <admin@cairis.org>
FROM debian:bookworm-slim
# Pin to Bookworm (Python 3.11). CAIRIS uses imghdr, which was removed in Python 3.13+.
LABEL maintainer="Shamal Faily <admin@cairis.org>"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y build-essential \
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
mysql-client \
default-mysql-client \
graphviz \
python3-pip \
python3-numpy \
python3-mysqldb \
git \
default-libmysqlclient-dev \
python3-apt \
libxml2-dev \
libxslt1-dev \
libssl-dev \
libmagic1 \
apache2 \
apache2-dev \
poppler-utils \
python3-setuptools \
apt-transport-https \
ca-certificates

RUN pip3 install wheel --break-system-packages
#Installing Python modules
COPY docker/requirements.txt /
RUN pip3 install -r requirements.txt --break-system-packages
COPY docker/wsgi_requirements.txt /
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY docker/requirements.txt docker/wsgi_requirements.txt /
RUN pip3 install wheel --break-system-packages \
&& pip3 install -r requirements.txt --break-system-packages
RUN pip3 install -r wsgi_requirements.txt --break-system-packages

#Environment Variable starts from here
ENV CAIRIS_SRC=/cairis/cairis
ENV CAIRIS_CFG_DIR=/cairis/docker
ENV CAIRIS_CFG=/cairis.cnf
ENV PYTHONPATH=/cairis
ENV CAIRIS_SRC=/cairis/cairis \
CAIRIS_CFG_DIR=/cairis/docker \
CAIRIS_CFG=/cairis.cnf \
PYTHONPATH=/cairis

RUN mkdir /tmpDocker
RUN mkdir /images
RUN mkdir /tmpDocker /images

#Clonning the repo
RUN git clone --depth 1 -b master https://github.com/cairis-platform/cairis /cairis
Expand All @@ -47,17 +44,22 @@ RUN mkdir /cairisTmp &&\
rm -rf /cairis/ &&\
mv /cairisTmp/ /cairis/

COPY docker/cairis.cnf /
COPY docker/setupDb.sh /
COPY docker/createdb.sql /
COPY docker/addAccount.sh /
COPY \
docker/cairis.cnf \
docker/setupDb.sh \
docker/createdb.sql \
docker/addAccount.sh \
/
COPY cairis/bin/installUI.sh /cairis/cairis/bin/installUI.sh
COPY docker/register_user.html /cairis/cairis/daemon/templates/security

RUN /cairis/cairis/bin/installUI.sh
RUN chmod +x /cairis/cairis/bin/installUI.sh \
&& /cairis/cairis/bin/installUI.sh

EXPOSE 8000
RUN apt-get remove --purge -y git \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get remove --purge -y git
RUN apt-get autoremove -y
EXPOSE 8000

CMD ["./setupDb.sh"]
32 changes: 17 additions & 15 deletions cairis/bin/installUI.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -x
#!/bin/bash
set -euo pipefail
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -13,20 +14,21 @@
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language go
#
# Author: Shamal Faily
# specific language governing permissions and limitations
# under the License.

# Author: Shamal Faily

export UI_REPO=/tmp/cairis-ui
rm -rf $UI_REPO
apt-get install curl
curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install -y yarn
apt-get install -y yarn
git clone https://github.com/cairis-platform/cairis-ui $UI_REPO
yarn --cwd $UI_REPO install --ignore-engines
yarn --cwd $UI_REPO run build
cp -r $UI_REPO/dist $CAIRIS_SRC
rm -rf "$UI_REPO"

apt-get update
apt-get install -y curl ca-certificates gnupg
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
npm install -g yarn

git clone https://github.com/cairis-platform/cairis-ui "$UI_REPO"
yarn --cwd "$UI_REPO" install --ignore-engines
yarn --cwd "$UI_REPO" run build
cp -r "$UI_REPO/dist" "$CAIRIS_SRC"