Skip to content

Commit 793d796

Browse files
Evgeny ShvarovEvgeny Shvarov
Evgeny Shvarov
authored and
Evgeny Shvarov
committed
added docker+VSCode files from objectscript-docker-template
1 parent d8045ce commit 793d796

9 files changed

+132
-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+

.vscode/launch.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "objectscript",
6+
"request": "launch",
7+
"name": "ObjectScript Debug Class",
8+
"program": "##class(PackageSample.ObjectScript).Test()",
9+
},
10+
{
11+
"type": "objectscript",
12+
"request": "attach",
13+
"name": "ObjectScript Attach",
14+
"processId": "${command:PickProcess}",
15+
"system": true
16+
}
17+
]
18+
}

.vscode/settings.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"files.associations": {
3+
4+
"Dockerfile*": "dockerfile",
5+
},
6+
"objectscript.conn" :{
7+
"ns": "IRISAPP",
8+
"active": true,
9+
"docker-compose": {
10+
"service": "iris",
11+
"internalPort": 52773
12+
}
13+
}
14+
15+
}

Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
FROM $IMAGE
6+
7+
USER root
8+
9+
WORKDIR /opt/irisapp
10+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
11+
12+
USER irisowner
13+
14+
COPY Installer.cls .
15+
COPY src src
16+
COPY irissession.sh /
17+
SHELL ["/irissession.sh"]
18+
19+
RUN \
20+
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
21+
set sc = ##class(App.Installer).setup()
22+
23+
# bringing the standard shell back
24+
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)