Skip to content

Commit f67ff4b

Browse files
authored
Added docker files for compatibility with 2020 Intersystems contest
1 parent 29c7861 commit f67ff4b

7 files changed

+100
-0
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/.DS_Store
2+
.git

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.sh text eol=lf
2+
*.cls text eol=lf
3+
*.mac text eol=lf
4+
*.int text eol=lf
5+
Dockerfil* text eol=lf

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
3+

Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ARG IMAGE=store/intersystems/irishealth:2019.3.0.308.0-community
2+
ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0
3+
ARG IMAGE=store/intersystems/iris-community:2019.4.0.379.0
4+
ARG IMAGE=store/intersystems/iris-community:2020.1.0.199.0
5+
ARG IMAGE=intersystemsdc/iris-community:2019.4.0.383.0-zpm
6+
FROM $IMAGE
7+
8+
USER root
9+
10+
WORKDIR /opt/irisapp
11+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
12+
13+
USER irisowner
14+
15+
COPY Installer.cls .
16+
COPY src src
17+
COPY irissession.sh /
18+
SHELL ["/irissession.sh"]
19+
20+
RUN \
21+
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
22+
set sc = ##class(App.Installer).setup()
23+
24+
# bringing the standard shell back
25+
SHELL ["/bin/bash", "-c"]

Installer.cls

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Class App.Installer
2+
{
3+
4+
XData setup
5+
{
6+
<Manifest>
7+
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}src"/>
8+
<Default Name="Namespace" Value="IRISAPP"/>
9+
<Default Name="app" Value="irisapp" />
10+
11+
<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">
12+
13+
<Configuration>
14+
<Database Name="${Namespace}" Dir="/opt/${app}/data" Create="yes" Resource="%DB_${Namespace}"/>
15+
16+
<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
17+
</Configuration>
18+
<CSPApplication Url="/csp/${app}" Directory="${cspdir}${app}" ServeFiles="1" Recurse="1" MatchRoles=":%DB_${Namespace}" AuthenticationMethods="32"
19+
20+
/>
21+
</Namespace>
22+
23+
</Manifest>
24+
}
25+
26+
ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
27+
{
28+
#; Let XGL document generate code for this method.
29+
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
30+
}
31+
32+
}

docker-compose.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.6'
2+
services:
3+
iris:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
restart: always
8+
ports:
9+
- 51773
10+
- 52773
11+
- 53773
12+
volumes:
13+
- ~/iris.key:/usr/irissys/mgr/iris.key
14+
- ./:/irisdev/app

irissession.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
iris start $ISC_PACKAGE_INSTANCENAME quietly
4+
5+
cat << EOF | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS
6+
do ##class(%SYSTEM.Process).CurrentDirectory("$PWD")
7+
$@
8+
if '\$Get(sc) do ##class(%SYSTEM.Process).Terminate(, 1)
9+
zn "%SYS"
10+
do ##class(SYS.Container).QuiesceForBundling()
11+
Do ##class(Security.Users).UnExpireUserPasswords("*")
12+
halt
13+
EOF
14+
15+
exit=$?
16+
17+
iris stop $ISC_PACKAGE_INSTANCENAME quietly
18+
19+
exit $exit

0 commit comments

Comments
 (0)