Skip to content

Commit ac88a61

Browse files
committed
Solid Docker image for the whole application
1 parent 7ff5705 commit ac88a61

11 files changed

Lines changed: 78 additions & 5994 deletions

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**/.*
2-
node_modules
2+
**/node_modules
33
build
44
*.log
55
*.md

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARG CACHE_VERSION=2017.2
2+
FROM node:8-alpine AS web
3+
4+
WORKDIR /opt/blocks/
5+
6+
COPY web ./
7+
8+
RUN npm install \
9+
&& export PATH="$PATH:./node_modules/.bin" \
10+
&& webpack --mode production
11+
12+
FROM daimor/intersystems-cache:${CACHE_VERSION}
13+
14+
WORKDIR /opt/blocks
15+
16+
COPY ./server/src/ ./src
17+
COPY --from=web /opt/blocks/build/ /usr/cachesys/csp/blocks/
18+
19+
RUN ccontrol start $ISC_PACKAGE_INSTANCENAME quietly \
20+
&& echo -e "" \
21+
"do ##class(%SYSTEM.OBJ).Load(\"/opt/blocks/src/DevInstaller.cls\",\"cdk\")\n" \
22+
"set sc=##class(Blocks.DevInstaller).setupWithVars(\"/opt/blocks/\")\n" \
23+
"do:'sc \$zu(4,\$j,1)\n" \
24+
"halt\n" \
25+
| csession $ISC_PACKAGE_INSTANCENAME -UUSER \
26+
# Stop Caché instance
27+
&& ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly
28+
29+
VOLUME [ "/opt/blocks/db" ]

Dockerfile.iris

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG IRIS_VERSION=2018.1
2+
FROM node:8-alpine AS web
3+
4+
WORKDIR /opt/blocks/
5+
6+
COPY web ./
7+
8+
RUN npm install \
9+
&& export PATH="$PATH:./node_modules/.bin" \
10+
&& webpack --mode production
11+
12+
FROM daimor/intersystems-iris:${IRIS_VERSION}
13+
14+
WORKDIR /opt/blocks/
15+
16+
COPY ./server/src/ ./src
17+
COPY --from=web /opt/blocks/build/ /usr/irissys/csp/blocks/
18+
19+
RUN iris start $ISC_PACKAGE_INSTANCENAME quietly \
20+
&& /bin/echo -e "do ##class(%SYSTEM.OBJ).Load(\"/opt/blocks/src/DevInstaller.cls\",\"cdk\")\n" \
21+
"set sc=##class(Blocks.DevInstaller).setupWithVars(\"/opt/blocks/\")\n" \
22+
"do:'sc \$zu(4,\$j,1)\n" \
23+
"Halt\n" \
24+
| iris session ${ISC_PACKAGE_INSTANCENAME} \
25+
&& iris stop $ISC_PACKAGE_INSTANCENAME quietly
26+
27+
VOLUME [ "/opt/blocks/db" ]

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ Database Blocks Explorer for InterSystems Caché
1515
+ Shows every block with the same colour for every globals;
1616
+ Legend for globals;
1717

18+
#### Run with Docker
19+
You need license key for Caché or IRIS on RedHat systems.
20+
##### Caché
21+
```
22+
docker run -d --name cacheblocksexplorer --rm \
23+
-p 52773:52773 \
24+
-v /opt/some/database/for/test:/opt/blocks/db/test \
25+
-v ~/cache.key:/usr/cachesys/mgr/cache.key
26+
daimor/cacheblocksexplorer:cache
27+
```
28+
##### IRIS
29+
```
30+
docker run -d --name cacheblocksexplorer --rm \
31+
-p 57772:57772 \
32+
-v /opt/some/database/for/test:/opt/blocks/db/test \
33+
-v ~/iris.key:/usr/irissys/mgr/iris.key
34+
daimor/cacheblocksexplorer:iris
35+
```
1836

1937
## Screenshots
2038

docker-compose.iris.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ services:
44
server:
55
build:
66
context: server
7-
dockerfile: Dockerfile-iris
7+
dockerfile: Dockerfile.iris
88
args:
9-
IRIS_KEY: ${IRIS_KEY}
10-
IRIS_VERSION: ${IRIS_VERSION}
9+
IRIS_VERSION: ${IRIS_VERSION-2018.1}
1110
ports:
1211
- "${IRIS_WEBPORT-52773}:52773"
1312
- "${IRIS_PORT-51773}:51773"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
build:
66
context: server
77
args:
8-
CACHE_VERSION: ${CACHE_VERSION}
8+
CACHE_VERSION: ${CACHE_VERSION-2017.1}
99
ports:
1010
- "${CACHE_WEBPORT-57772}:57772"
1111
- "${CACHE_PORT-1972}:1972"

web/package-lock.json

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"babel-preset-env": "^1.7.0",
2727
"css-loader": "^1.0.0",
2828
"eslint": "^5.5.0",
29-
"extract-text-webpack-plugin": "^3.0.2",
3029
"fs": "0.0.2",
3130
"html-loader": "^0.5.4",
3231
"html-webpack-plugin": "^3.2.0",

web/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
var webpack = require('webpack');
33
var path = require('path');
44
var HtmlWebpackPlugin = require('html-webpack-plugin');
5-
var ExtractTextPlugin = require('extract-text-webpack-plugin');
65

76
const db_host = process.env['DB_HOST'] || 'localhost';
87
const db_port = process.env['DB_PORT'] || 57772;

0 commit comments

Comments
 (0)