diff --git a/.gitignore b/.gitignore index 3e82971..fc57d60 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,7 @@ dist .tern-port # vscode -.vscode \ No newline at end of file +.vscode + +compose.yaml +compose-local-mongo.yaml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c095880..050dc55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,23 @@ -FROM node:18-alpine +# Stage 1 - Gather dependencies +#FROM node:19 AS deps +#COPY . . +#RUN npm ci + +# Stage 2 - Runner +#FROM node:20-alpine as runner +FROM node:20 +# RUN git config --global url."https://github.com/".insteadOf 'git@github.com:' +# RUN git config --global url."https://github.com/".insteadOf git@github.com: +# RUN git config --global url."https://".insteadOf git:// +#RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com +# RUN git config --global url."https://github.com".insteadOf "ssh://git@github.com" +# NOTE to self: I got this to work (i.e., fixed the problem with the docker build +# not being able to pull the status dependency - +# digitalcredentials/credential-status-manager-db#initial-implementation +# from git ) by instead pulling in the dependency locally so it gets copied +# directly into the docker build as part of copying in all of the local node_modules. +# I also therefore had to remove node_moduels from the dockerignore WORKDIR /app COPY . . -RUN npm install CMD ["node", "server.js"] EXPOSE 4008 diff --git a/package.json b/package.json index 3c0c5eb..18db57f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "NODE_OPTIONS=--experimental-vm-modules npx mocha --timeout 10000 -r dotenv/config dotenv_config_path=src/test-fixtures/.env.testing src/app.test.js " }, "dependencies": { - "@digitalcredentials/credential-status-manager-db": "digitalcredentials/credential-status-manager-db#initial-implementation", + "@digitalcredentials/credential-status-manager-db": "^0.0.1-beta.1", "cookie-parser": "~1.4.4", "cors": "^2.8.5", "debug": "~2.6.9", diff --git a/src/app.js b/src/app.js index cf4b0df..2b78ecd 100644 --- a/src/app.js +++ b/src/app.js @@ -35,6 +35,8 @@ export async function build(opts = {}) { const vcWithStatus = await status.allocateRevocationStatus(vc); return res.json(vcWithStatus); } catch (e) { + + console.log(e) // We catch the async errors and pass them to the error handler. if (!e.message) { e.message = 'Unable to allocate status position.'