Skip to content

Commit

Permalink
Merge pull request #315 from evshvarov/master
Browse files Browse the repository at this point in the history
docker infrastructure optimisation
  • Loading branch information
gnibeda authored Mar 24, 2024
2 parents 5dc2681 + 25df2c7 commit ef454bb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 60 deletions.
59 changes: 25 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
ARG IMAGE=store/intersystems/iris-aa-community:2020.3.0AA.331.0
ARG IMAGE=intersystemsdc/iris-community:2020.2.0.196.0-zpm
ARG IMAGE=intersystemsdc/iris-aa-community:2020.3.0AA.331.0-zpm
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.200.0-zpm
ARG IMAGE=intersystemsdc/irishealth-community:2020.4.0.524.0-zpm
ARG IMAGE=intersystemsdc/irishealth-community:2021.1.0.215.3-zpm
ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.547.0-zpm
ARG IMAGE=containers.intersystems.com/intersystems/iris:2021.1.0.215.0
ARG IMAGE=intersystemsdc/iris-community:preview
ARG IMAGE=intersystemsdc/irishealth-community
ARG IMAGE=intersystemsdc/iris-community
FROM $IMAGE

USER root
WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
WORKDIR /home/irisowner/irisdev

COPY irissession.sh /
RUN chmod +x /irissession.sh
## install git
## USER root
##RUN apt update && apt-get -y install git
##USER ${ISC_PACKAGE_MGRUSER}

USER ${ISC_PACKAGE_MGRUSER}
ARG TESTS=0
ARG MODULE="dc-sample"
ARG NAMESPACE="IRISAPP"

# copy files
COPY Installer.cls .
# COPY src src
# COPY iris.script /tmp/iris.script
SHELL ["/irissession.sh"]
## Embedded Python environment
ENV IRISUSERNAME "_SYSTEM"
ENV IRISPASSWORD "SYS"
ENV IRISNAMESPACE $NAMESPACE
ENV PYTHON_PATH=/usr/irissys/bin/
ENV PATH "/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin"

RUN \
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
set sc = ##class(App.Installer).setup() \
zn "IRISAPP" \
zpm "install dsw" \
zpm "install samples-bi"

# bringing the standard shell back
SHELL ["/bin/bash", "-c"]

# special extract treatment for hate-speech dataset
# RUN mkdir /data/hate-speech/ \
# && tar -xf /data/hate-speech.tar -C /data/

# load demo stuff
RUN iris start IRIS
RUN rm -r /usr/irissys/csp/dsw/*
COPY ./dist/. /usr/irissys/csp/dsw/
RUN --mount=type=bind,src=.,dst=. \
pip3 install -r requirements.txt && \
iris start IRIS && \
iris session IRIS < iris.script && \
([ $TESTS -eq 0 ] || iris session iris -U $NAMESPACE "##class(%ZPM.PackageManager).Shell(\"test $MODULE -v -only\",1,1)") && \
iris stop IRIS quietly
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '3.6'
services:
iris:
build:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 1972:1972
- 52773:52773
- 53773:53773
command: --check-caps false
ports:
- 1972
- 52773
- 53773
volumes:
- ~/iris.key:/usr/irissys/mgr/iris.key
- ./:/irisdev/app
- ./:/home/irisowner/irisdev
19 changes: 19 additions & 0 deletions iris.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Unexpire passwords to simplify dev mode. Comment these two lines for Production use
zn "%SYS"
Do ##class(Security.Users).UnExpireUserPasswords("*")

; enabling callin for Embedded Python
do ##class(Security.Services).Get("%Service_CallIn",.prop)
set prop("Enabled")=1
set prop("AutheEnabled")=48
do ##class(Security.Services).Modify("%Service_CallIn",.prop)

// create IRISAPP namespace
do $SYSTEM.OBJ.Load("/home/irisowner/irisdev/Installer.cls", "ck")
set sc = ##class(App.Installer).setup()


// load all the code of the project as a ZPM package
zn "IRISAPP"
zpm "load /home/irisowner/irisdev/ -v":1:1
halt
19 changes: 0 additions & 19 deletions irissession.sh

This file was deleted.

0 comments on commit ef454bb

Please sign in to comment.