Skip to content

Commit

Permalink
changes for the development with docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Shvarov authored and Evgeny Shvarov committed Feb 9, 2019
1 parent b6a169c commit 9f80ee6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM intersystems/iris:2019.1.0S.111.0

WORKDIR /opt/app

COPY ./Installer.cls ./
COPY ./cls/ ./src/

RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
/bin/echo -e "sys\nsys\n" \
" Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \
" Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \
" Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \
" Set sc = ##class(App.Installer).setup(, 3)\n" \
" If 'sc do \$zu(4, \$JOB, 1)\n" \
" halt" \
| iris session $ISC_PACKAGE_INSTANCENAME && \
/bin/echo -e "sys\nsys\n" \
| iris stop $ISC_PACKAGE_INSTANCENAME quietly

CMD [ "-l", "/usr/irissys/mgr/messages.log" ]
29 changes: 29 additions & 0 deletions Installer.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Class App.Installer
{

XData MyInstall [ XMLNamespace = INSTALLER ]
{
<Manifest>
<Default Name="NAMESPACE" Value="TEST"/>
<Default Name="DBNAME" Value="TEST"/>
<Default Name="APPPATH" Dir="/opt/app/" />
<Default Name="SOURCESPATH" Dir="${APPPATH}src" />
<Default Name="RESOURCE" Value="%DB_${DBNAME}" />

<Namespace Name="${NAMESPACE}" Code="${DBNAME}-CODE" Data="${DBNAME}-DATA" Create="yes" Ensemble="0">
<Configuration>
<Database Name="${DBNAME}-CODE" Dir="${APPPATH}${DBNAME}-CODE" Create="yes" Resource="${RESOURCE}"/>
<Database Name="${DBNAME}-DATA" Dir="${APPPATH}${DBNAME}-DATA" Create="yes" Resource="${RESOURCE}"/>
</Configuration>

<Import File="${SOURCESPATH}" Recurse="1"/>
</Namespace>

</Manifest>
}

ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "MyInstall")
}
}
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2.4'
services:
iris:
build: .
restart: always
ports:
- 52773:52773
volumes:
- ~/iris.key:/usr/irissys/mgr/iris.key

0 comments on commit 9f80ee6

Please sign in to comment.