There was inconsistency in the worker compose yaml for depends_on. The worker requires both db and redis, and in the default docker-compose.yml it was missing db, causing worker to crash on `docker-compose up`. In two other compose files for stacks, where depends_on was used for other services, I added it for the worker to match.
The result app was years out of date with node and npm packages, and required multiple changes to use the current supported socket.io and postgres db libs. Minimal changes to server.js to support change in pg syntax. A few minor changes to Dockerfile to improve readability, conform to docker best practices, and change to use npm ci to ensure future builds don't break again due to difference between package and package-lock.
To match other .js loading patterns in this repo, don't use a CDN angular, but rather a local copy in case examples are used offline or in large classrooms with slow internet. Also updated to latest angular 1.4
This patch optimizes the java-worker image;
- Use multi-stage build to separate the build-stage from the "deploy" stage
- Switch to the official Maven image, instead of manual installation of Maven.
The official Maven image is also based on the `openjdk` repository on Docker
Hub, which replaces the (now deprecated) `java` repository.
- Use `COPY` instead of `ADD` to follow best-practice
- Add `-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap` arguments
so that JAVA will take memory-limits into account
- Use a JRE base image for the final build-stage
This change brings the size of the final image down from 184MB to 87MB
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This patch makes some optimizations in the result service's image;
- switch to `node:8.9-alpine`, which a smaller base image
- use `https://` for the registry
- use `COPY` instead of `ADD`, following best pracice
- cleanup npm cache, and combine steps to reduce image size
These changes bring down the image size from 248MB to 81.2MB
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The `--debug` option is deprecated and caused the result
service to not start:
result_1 | [nodemon] 1.14.7
result_1 | [nodemon] to restart at any time, enter `rs`
result_1 | [nodemon] watching: *.*
result_1 | [nodemon] starting `node --debug server.js`
result_1 | (node:20) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
result_1 | [nodemon] app crashed - waiting for file changes before starting...
This patch removes the `--debug` option, as it's not needed,
and no longer present in the other example stacks.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>