Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.DS_Store
.git
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.sh text eol=lf
*.cls text eol=lf
*.mac text eol=lf
*.int text eol=lf
Dockerfil* text eol=lf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store


24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG IMAGE=store/intersystems/irishealth:2019.3.0.308.0-community
ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0
ARG IMAGE=store/intersystems/iris-community:2019.4.0.379.0
ARG IMAGE=store/intersystems/iris-community:2020.1.0.199.0
FROM $IMAGE

USER root

WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp

USER irisowner

COPY Installer.cls .
COPY src src
COPY irissession.sh /
SHELL ["/irissession.sh"]

RUN \
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
set sc = ##class(App.Installer).setup()

# bringing the standard shell back
SHELL ["/bin/bash", "-c"]
32 changes: 32 additions & 0 deletions Installer.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Class App.Installer
{

XData setup
{
<Manifest>
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}src"/>
<Default Name="Namespace" Value="IRISAPP"/>
<Default Name="app" Value="irisapp" />

<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">

<Configuration>
<Database Name="${Namespace}" Dir="/opt/${app}/data" Create="yes" Resource="%DB_${Namespace}"/>

<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
</Configuration>
<CSPApplication Url="/csp/${app}" Directory="${cspdir}${app}" ServeFiles="1" Recurse="1" MatchRoles=":%DB_${Namespace}" AuthenticationMethods="32"

/>
</Namespace>

</Manifest>
}

ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
#; Let XGL document generate code for this method.
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
}

}
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,20 @@ How it works :
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GGBL_using_storing
https://community.intersystems.com/post/m-cell

Download IRIS: https://www.intersystems.com/try-intersystems-iris-for-free/
https://download.intersystems.com/download/login.csp

Preparation for start MX with Cache 8-bit or unicode, or IRIS InterSystems :
- download the repository as ZIP file, then unzip to a separate folder, for example: to c:\mx\
- if you don’t yet have Cache or IRIS, download and install IRIS, preferably in unicode, on any win-computer
- start IRIS (Cache) terminal, then run the following commands after USER>:

zn "yournspace"
Set root = "path on filesystem to which repository was downloaded"
Do $System.OBJ.ImportDir(root,"vmx.ro","ck",,1) Do ^ZSTU
( Alternative option : USER> zn "yournspace" Do ^%RI Do ^ZSTU )

For start project with docker
- edit the [connections] table in the MX_CONFI.xlsb (edit m-server-IP4-address, tcp port, $znspace)
- run mx.xlsb (MS EXCEL be sure, required dot . as system-decimal-delimiter) then select and press the big button to connect to the mx-server

Then you will see sheet with buttons for calling tests and games.
You can test MX without m-server installation - just start mx-sea-battle.xlsb.

For install IRIS LINUX in docker, unzip repozitory to /mx/, then enter:
$ docker run --name myiris -v /mx/:/mx -p 5264:5264 -d store/intersystems/iris-community:2020.1.0.202.0
For install IRIS LINUX in docker, unzip repozitory to /path/to/mymx, then enter:
$ docker run --name myiris -v /path/to/mymx:/mx -p 5264:5264 -d store/intersystems/iris-community:2020.1.0.202.0
$ docker exec -it myiris session iris
USER>do $System.OBJ.ImportDir("/mx","vmx.ro","ck",,1) do ^ZSTU


With MX :

- you can create new complex projects, or use MX as an auxiliary tool
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.6'
services:
iris:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 51773
- 52773
- 53773
- 5264:5264
volumes:
- ~/iris.key:/usr/irissys/mgr/iris.key
- ./:/irisdev/app
19 changes: 19 additions & 0 deletions irissession.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

iris start $ISC_PACKAGE_INSTANCENAME quietly

cat << EOF | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS
do ##class(%SYSTEM.Process).CurrentDirectory("$PWD")
$@
if '\$Get(sc) do ##class(%SYSTEM.Process).Terminate(, 1)
zn "%SYS"
do ##class(SYS.Container).QuiesceForBundling()
Do ##class(Security.Users).UnExpireUserPasswords("*")
halt
EOF

exit=$?

iris stop $ISC_PACKAGE_INSTANCENAME quietly

exit $exit