7 |
8 | # update OS + dependencies & run Caché silent instal
9 | RUN yum -y update && yum -y install which tar hostname net-tools httpd && yum -y clean all &&\
10 | ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Moscow
11 |
12 | ARG globals8k=256
13 | ARG routines=64
14 | ARG locksiz
15 | ARG gmheap
16 |
17 | ENV TMP_INSTALL_DIR=/tmp/distrib
18 |
19 | # vars for Caché silent install
20 | ENV ISC_PACKAGE_INSTANCENAME="CACHE" \
21 | ISC_PACKAGE_INSTALLDIR="/usr/cachesys" \
22 | ISC_PACKAGE_UNICODE="Y" \
23 | ISC_PACKAGE_CSP_GATEWAY_DIR="/opt/cspgateway/" \
24 | ISC_PACKAGE_CSP_CONFIGURE="Y" \
25 | ISC_PACKAGE_CSP_SERVERTYPE="Apache" \
26 | ISC_PACKAGE_CSP_APACHE_VERSION=2.4
27 |
28 | # vars for install our application
29 | ENV ISC_INSTALLER_MANIFEST=${TMP_INSTALL_DIR}/MyApp.ECPClientInstaller.cls \
30 | ISC_INSTALLER_LOGLEVEL=3 \
31 | ISC_INSTALLER_PARAMETERS="routines=$routines,locksiz=$locksiz,gmheap=$gmheap,globals8k=$globals8k"
32 |
33 | # set-up and install Caché from distrib_tmp dir
34 | RUN mkdir ${TMP_INSTALL_DIR}
35 | WORKDIR ${TMP_INSTALL_DIR}
36 |
37 | # cache distributive
38 | ADD cache-2016.2.0.623.0-lnxrhx64.tar.gz .
39 |
40 | # our application installer
41 | ADD MyApp.ECPClientInstaller.cls .
42 |
43 | RUN mkdir /opt/myapp/ && \
44 | env | grep ISC_ && \
45 | ./cache-2016.2.0.623.0-lnxrhx64/cinstall_silent && \
46 | cat $ISC_PACKAGE_INSTALLDIR/mgr/cconsole.log && \
47 | rm -rf ${TMP_INSTALL_DIR}
48 |
49 | # license file
50 | ADD cache.key $ISC_PACKAGE_INSTALLDIR/mgr/
51 | ADD mod_csp.conf /etc/httpd/conf.d/
52 | RUN ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly
53 |
54 | # TCP sockets that can be accessed if user wants to (see 'docker run -p' flag)
55 | EXPOSE 80 57772 1972 22
56 |
57 | # Caché container main process PID 1 (https://github.com/zrml/ccontainermain)
58 | WORKDIR /
59 | ADD ccontainermain .
60 | ADD httpd.sh .
61 | RUN cp run.sh sshd.sh && chmod a+x httpd.sh
62 |
63 | ENTRYPOINT ["/ccontainermain", "-cconsole", "-xstart=/httpd.sh"]
64 |
65 |
--------------------------------------------------------------------------------
/ECP-client/MyApp.ECPClientInstaller.cls:
--------------------------------------------------------------------------------
1 | Class MyApp.ECPClientInstaller
2 | {
3 |
4 | XData setup [ XMLNamespace = INSTALLER ]
5 | {
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | }
46 |
47 | ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3,
48 | pInstaller As %Installer.Installer,
49 | pLogger As %Installer.AbstractLogger)
50 | As %Status [ CodeMode = objectgenerator, Internal ]
51 | {
52 | do %code.WriteLine($char(9)_"set pVars(""CURRENTCLASS"")="""_%classname_"""")
53 | do %code.WriteLine($char(9)_"set pVars(""CURRENTNS"")="""_$namespace_"""")
54 | #; Let our XGL document generate code for this method.
55 | Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
56 | }
57 |
58 | ClassMethod SetupECPClient(ServerName As %String, ServerAddr As %String, ServerPort As %Integer) As %Status
59 | {
60 | new $namespace
61 | set $namespace = "%SYS"
62 |
63 | set props("Address") = ServerAddr
64 | set props("Port") = ServerPort
65 |
66 | quit ##class(Config.ECPServers).Create(ServerName, .props)
67 | }
68 |
69 | ClassMethod RemoteDatabase(DatabaseName As %String, ServerName As %String, Directory As %String) As %Status
70 | {
71 | new $namespace
72 | set $namespace = "%SYS"
73 |
74 | set props("Server") = ServerName
75 | set props("Directory") = Directory
76 |
77 | quit ##class(Config.Databases).Create(DatabaseName, .props)
78 | }
79 |
80 | }
--------------------------------------------------------------------------------
/ECP-client/MyApp.Main.cls:
--------------------------------------------------------------------------------
1 | Class MyApp.Main Extends %CSP.Page
2 | {
3 |
4 |
5 | ClassMethod OnPage() As %Status
6 | {
7 | &html<
8 |
9 |
10 |
20 |
21 |
22 |
23 |
Hello you are on:
24 | #(%request.GatewayInstanceName)#
25 |
26 |
27 | >
28 | quit $$$OK
29 | }
30 |
31 |
32 | }
--------------------------------------------------------------------------------
/ECP-client/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | services:
4 | cache:
5 | build: .
6 | ports:
7 | - "2222:22"
8 | - "80:80"
9 | privileged: true
10 | command:
11 | -cconsole
12 | -xstart=/httpd.sh
13 |
--------------------------------------------------------------------------------
/ECP-client/httpd.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | /usr/sbin/httpd -d /etc/httpd/ -f /etc/httpd/conf/httpd.conf
4 |
5 | /run.sh
--------------------------------------------------------------------------------
/ECP-client/mod_csp.conf:
--------------------------------------------------------------------------------
1 |
2 | AddType application/x-csp csp cls zen
3 |
4 |
5 | Require all denied
6 |
7 |
8 | RewriteEngine on
9 | RewriteRule "^/$" "/myapp/MyApp.Main.cls" [R]
10 |
11 | #Alias /myapp /opt/myapp
12 |
13 | CSP On
14 | SetHandler csp-handler-sa
15 |
16 |
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Dmitry Maslennikov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # docker-intersystems-examples
2 |
--------------------------------------------------------------------------------
/ccontainermain:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimor/docker-intersystems-examples/dc796319813e455e6198d5e1d2314c8ac9b69844/ccontainermain
--------------------------------------------------------------------------------
/httpd-csp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM httpd:2.4
2 |
3 | MAINTAINER Dmitry Maslennikov
4 |
5 | COPY ./cspgateway/ /opt/cspgateway/bin
6 |
7 | COPY httpd-csp.conf ./conf/extra
8 |
9 | RUN echo "Include conf/extra/httpd-csp.conf" >> ./conf/httpd.conf \
10 | && mkdir -p /opt/cspgateway/csp \
11 | && chown -R www-data:www-data /opt/cspgateway \
12 | && chgrp -R www-data ./conf/extra/httpd-csp.conf
13 |
--------------------------------------------------------------------------------
/httpd-csp/README.md:
--------------------------------------------------------------------------------
1 | ## httpd-csp
2 |
3 | This docker image, is an example of apache httpd server with cspgateway to InterSystems Caché products.
--------------------------------------------------------------------------------
/httpd-csp/cspgateway/CSP.ini:
--------------------------------------------------------------------------------
1 | [SYSTEM]
2 | No_Activity_Timeout=1800
3 | System_Manager=*.*.*.*
4 | SM_Timeout=300
5 | Server_Response_Timeout=60
6 | Queued_Request_Timeout=60
7 | Event_Log_File=/proc/self/fd/1
8 |
9 | [LOCAL]
10 | Ip_Address=ensemble
11 | TCP_Port=1972
12 | Minimum_Server_Connections=3
13 | Maximum_Session_Connections=6
14 |
15 | [SYSTEM_INDEX]
16 | LOCAL=Enabled
17 |
18 | [APP_PATH_INDEX]
19 | /=Enabled
20 | /csp=Enabled
21 |
22 | [APP_PATH:/]
23 | Default_Server=LOCAL
24 |
25 | [APP_PATH:/csp]
26 | Default_Server=LOCAL
--------------------------------------------------------------------------------
/httpd-csp/cspgateway/CSPa24.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimor/docker-intersystems-examples/dc796319813e455e6198d5e1d2314c8ac9b69844/httpd-csp/cspgateway/CSPa24.so
--------------------------------------------------------------------------------
/httpd-csp/cspgateway/CSPa24Sys.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimor/docker-intersystems-examples/dc796319813e455e6198d5e1d2314c8ac9b69844/httpd-csp/cspgateway/CSPa24Sys.so
--------------------------------------------------------------------------------
/httpd-csp/cspgateway/libz.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimor/docker-intersystems-examples/dc796319813e455e6198d5e1d2314c8ac9b69844/httpd-csp/cspgateway/libz.so
--------------------------------------------------------------------------------
/httpd-csp/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "2.0"
2 |
3 | services:
4 | ensemble:
5 | image: ensemble
6 | ports:
7 | - 57772:57772
8 |
9 | httpd-csp:
10 | image: httpd-csp
11 | build: ./
12 | ports:
13 | - 80:80
14 | links:
15 | - ensemble
--------------------------------------------------------------------------------
/httpd-csp/httpd-csp.conf:
--------------------------------------------------------------------------------
1 | LoadModule csp_module_sa /opt/cspgateway/bin/CSPa24.so
2 | CSPModulePath /opt/cspgateway/bin/
3 |
4 |
5 | SetHandler cspsys-handler-sa
6 |
7 |
8 |
9 | SetHandler csp-handler-sa
10 |
11 |
12 | CSPFileTypes csp cls zen cxw
13 |
14 |
15 | SetHandler csp-handler-sa
16 |
17 |
18 |
19 | AllowOverride None
20 | Options MultiViews FollowSymLinks ExecCGI
21 | Require all granted
22 |
23 |
24 | Require all denied
25 |
26 |
--------------------------------------------------------------------------------
/simple/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM centos:6
2 |
3 | MAINTAINER Dmitry Maslennikov
4 |
5 | # update OS + dependencies & run Caché silent instal
6 | RUN yum -y update \
7 | && yum -y install which tar hostname net-tools wget \
8 | && yum -y clean all \
9 | && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague
10 |
11 | ARG password="Qwerty@12"
12 | ARG cache=ensemble-2016.2.1.803.1
13 |
14 | ENV TMP_INSTALL_DIR=/tmp/distrib
15 |
16 | # vars for Caché silent install
17 | ENV ISC_PACKAGE_INSTANCENAME="ENSEMBLE" \
18 | ISC_PACKAGE_INSTALLDIR="/opt/ensemble/" \
19 | ISC_PACKAGE_UNICODE="Y" \
20 | ISC_PACKAGE_CLIENT_COMPONENTS="" \
21 | ISC_PACKAGE_INITIAL_SECURITY="Normal" \
22 | ISC_PACKAGE_USER_PASSWORD=${password}
23 |
24 | # set-up and install Caché from distrib_tmp dir
25 | WORKDIR ${TMP_INSTALL_DIR}
26 |
27 | ADD $cache-lnxrhx64.tar.gz .
28 |
29 | # cache distributive
30 | RUN ./$cache-lnxrhx64/cinstall_silent \
31 | && ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly \
32 | # Caché container main process PID 1 (https://github.com/zrml/ccontainermain)
33 | && curl -L https://github.com/daimor/ccontainermain/raw/master/distrib/linux/ccontainermain -o /ccontainermain \
34 | && chmod +x /ccontainermain \
35 | && rm -rf $TMP_INSTALL_DIR
36 |
37 | # # Workaround for an overlayfs bug which prevents Cache from starting with errors
38 | # COPY ccontrol-wrapper.sh /usr/bin/
39 | # RUN cd /usr/bin \
40 | # && rm ccontrol \
41 | # && mv ccontrol-wrapper.sh ccontrol \
42 | # && chmod 555 ccontrol
43 |
44 | WORKDIR ${ISC_PACKAGE_INSTALLDIR}
45 |
46 | # TCP sockets that can be accessed if user wants to (see 'docker run -p' flag)
47 | EXPOSE 57772 1972
48 |
49 | ENTRYPOINT ["/ccontainermain", "-cconsole", "-i", "ensemble"]
--------------------------------------------------------------------------------
/simple/Dockerfile.WRC:
--------------------------------------------------------------------------------
1 | FROM centos:6
2 |
3 | MAINTAINER Dmitry Maslennikov
4 |
5 | # update OS + dependencies & run Caché silent instal
6 | RUN yum -y update \
7 | && yum -y install which tar hostname net-tools wget \
8 | && yum -y clean all \
9 | && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague
10 |
11 | ARG password="Qwerty@12"
12 | ARG cache=ensemble-2016.2.1.803.1
13 | ARG WRC_USERNAME=”username”
14 | ARG WRC_PASSWORD=”password”
15 |
16 | ENV TMP_INSTALL_DIR=/tmp/distrib
17 |
18 | # vars for Caché silent install
19 | ENV ISC_PACKAGE_INSTANCENAME="ENSEMBLE" \
20 | ISC_PACKAGE_INSTALLDIR="/opt/ensemble/" \
21 | ISC_PACKAGE_UNICODE="Y" \
22 | ISC_PACKAGE_CLIENT_COMPONENTS="" \
23 | ISC_PACKAGE_INITIAL_SECURITY="Normal" \
24 | ISC_PACKAGE_USER_PASSWORD=${password}
25 |
26 | # set-up and install Caché from distrib_tmp dir
27 | WORKDIR ${TMP_INSTALL_DIR}
28 |
29 | # cache distributive
30 | RUN wget -qO /dev/null --keep-session-cookies --save-cookies /dev/stdout --post-data="UserName=$WRC_USERNAME&Password=$WRC_PASSWORD" 'https://login.intersystems.com/login/SSO.UI.Login.cls?referrer=https%253A//wrc.intersystems.com/wrc/login.csp' \
31 | | wget -O - --load-cookies /dev/stdin "https://wrc.intersystems.com/wrc/WRC.StreamServer.cls?FILE=/wrc/distrib/$cache-lnxrhx64.tar.gz" \
32 | | tar xvfzC - . \
33 | && ./$cache-lnxrhx64/cinstall_silent \
34 | && ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly \
35 | # Caché container main process PID 1 (https://github.com/zrml/ccontainermain)
36 | && curl -L https://github.com/daimor/ccontainermain/raw/master/distrib/linux/ccontainermain -o /ccontainermain \
37 | && chmod +x /ccontainermain \
38 | && rm -rf $TMP_INSTALL_DIR
39 |
40 | # # Workaround for an overlayfs bug which prevents Cache from starting with errors
41 | # COPY ccontrol-wrapper.sh /usr/bin/
42 | # RUN cd /usr/bin \
43 | # && rm ccontrol \
44 | # && mv ccontrol-wrapper.sh ccontrol \
45 | # && chmod 555 ccontrol
46 |
47 | WORKDIR ${ISC_PACKAGE_INSTALLDIR}
48 |
49 | # TCP sockets that can be accessed if user wants to (see 'docker run -p' flag)
50 | EXPOSE 57772 1972
51 |
52 | ENTRYPOINT ["/ccontainermain", "-cconsole", "-i", "ensemble"]
--------------------------------------------------------------------------------
/simple/ccontrol-wrapper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Work around a werid overlayfs bug where files don't open properly if they haven't been
4 | # touched first - see the yum-ovl plugin for a similar workaround
5 | if [ "${1,,}" == "start" ]; then
6 | find $ISC_PACKAGE_INSTALLDIR -name CACHE.DAT -exec touch {} \;
7 | fi
8 |
9 | /usr/local/etc/cachesys/ccontrol $@
--------------------------------------------------------------------------------
/simple/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.0'
2 |
3 | services:
4 | ensemble:
5 | image: simple-ensemble
6 | build: .
7 | ports:
8 | - 57772:57772
--------------------------------------------------------------------------------
/webterminal/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM daimor/intersystems-ensemble
2 |
3 | # Version of WebTerminal to install
4 | ARG TerminalVersion=4.2.14
5 |
6 | # Create temporary folder
7 | RUN mkdir /tmp/webterminal \
8 |
9 | # Download installation xml from github
10 | && curl http://intersystems-ru.github.io/webterminal/files/WebTerminal-v$TerminalVersion.xml -o /tmp/webterminal/webterminal.xml \
11 |
12 | # Start Caché Instance
13 | && ccontrol start $ISC_PACKAGE_INSTANCENAME \
14 |
15 | # Generate login and password for csession if needed, and Load downloaded xml with compilation
16 | # WebTerminal will be installed during compilation process
17 | && printf "_SYSTEM\n$ISC_PACKAGE_USER_PASSWORD\n" \
18 | | csession $ISC_PACKAGE_INSTANCENAME -UUSER "##class(%SYSTEM.OBJ).Load(\"/tmp/webterminal/webterminal.xml\",\"cdk\")" \
19 |
20 | # Stop Caché instance
21 | && ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly \
22 |
23 | # Clean Temporary folder
24 | && rm -rf /tmp/webterminal/
--------------------------------------------------------------------------------
/webterminal/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | terminal:
5 | build: .
6 | ports:
7 | - 57772:57772
8 |
--------------------------------------------------------------------------------