Skip to content

Commit

Permalink
fix: npm, deps and node
Browse files Browse the repository at this point in the history
  • Loading branch information
rorlic committed Dec 27, 2024
1 parent 0479e8b commit 6d17a68
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 72 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# build environment
FROM node:18-bullseye-slim AS builder
FROM node:22-bullseye-slim AS builder
# fix vulnerabilities
ARG NPM_TAG=9.6.4
ARG NPM_TAG=11.0.0
RUN npm install -g npm@${NPM_TAG}
# build it
WORKDIR /build
Expand All @@ -10,7 +10,7 @@ RUN npm ci
RUN npm run build

# run environment
FROM node:18.16.0-bullseye-slim
FROM node:22.12.0-bullseye-slim
# fix vulnerabilities
# note: trivy insists this to be on the same RUN line
RUN apt-get -y update && apt-get -y upgrade
Expand All @@ -34,7 +34,7 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# fix vulnerabilities
RUN npm install -g npm@${NPM_TAG}
# install dependancies
ENV NODE_ENV production
ENV NODE_ENV=production
RUN npm ci --omit=dev
USER node
CMD ["sh", "-c", "node ./index.js --silent=${SILENT} --mime-type=${MIME_TYPE} --poll-interval=${POLL_INTERVAL} --follow=${FOLLOW}"]
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ The tool can be run as a Docker container, using a pre-built container or after

To create a Docker image, run the following command:
```bash
docker build --tag vsds/ldes-list-fragments .
docker build --tag vsds/ldes-list-fragments:latest .
```

To run the Docker image mapped and follow an LDES view, you can run it interactively, e.g.:
```bash
docker run --rm -it \
-e FOLLOW=https://gtfs.smartdataspace.dev-vlaanderen.be/connections/by-stop-and-time \
vsds/ldes-list-fragments:latest
docker run --rm -it -e FOLLOW=hhttps://ldes.telraam-api.net/observations/by-page vsds/ldes-list-fragments:latest
```
> **Note**: this is a large data set so you may want to interrupt the container with `CTRL-C`.
Expand All @@ -42,7 +40,6 @@ The tool takes the following command line arguments:

You can run the tool providing the mandatory view URL (and one or more optional arguments) after building it, e.g.:
```bash
node dist/index.js --silent false --mime-type "text/turtle" --poll-interval 30000 \
--follow https://gtfs.smartdataspace.dev-vlaanderen.be/connections/by-stop-and-time
node dist/index.js --silent false --mime-type "text/turtle" --poll-interval 30000 --follow https://ldes.telraam-api.net/observations/by-page
```
> **Note**: again, this is a large data set so you may want to interrupt the tool with `CTRL-C`.
125 changes: 71 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
"author": "Ranko Orlic",
"license": "EUPL-1.2",
"dependencies": {
"cache-control-parser": "^2.0.4",
"cache-control-parser": "^2.0.6",
"minimist": "^1.2.8",
"n3": "^1.16.4",
"node-fetch": "^3.3.1",
"n3": "^1.23.1",
"node-fetch": "^3.3.2",
"sorted-queue": "^0.3.5"
},
"devDependencies": {
"@types/minimist": "^1.2.2",
"@types/n3": "^1.10.4",
"@types/node": "^18.15.11",
"@types/node-fetch": "^2.6.3",
"typescript": "^4.9.4"
"@types/minimist": "^1.2.5",
"@types/n3": "^1.21.1",
"@types/node": "^22.10.2",
"@types/node-fetch": "^2.6.12",
"typescript": "^5.7.2"
}
}

0 comments on commit 6d17a68

Please sign in to comment.