aiiinotate 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docker/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # syntax=docker/dockerfile:1
2
- FROM node:23.11 AS aiiinotate
2
+ FROM node:23.11
3
3
 
4
4
  # aiiinotate port
5
5
  ARG PORT
@@ -10,15 +10,13 @@ ENV TERM=linux
10
10
  SHELL ["/bin/bash", "-c"]
11
11
 
12
12
  # root of the app in the docker container
13
- WORKDIR $ROOT_AIIINOTATE
13
+ WORKDIR /aiiinotate
14
14
  # copy the docker .env in the docker container
15
15
  COPY ./docker/.env /aiiinotate/.env
16
16
  # for debug: install `iproute2` which provides CLI `ss` to monitor active ports
17
17
  RUN apt update && apt install iproute2 -y
18
- # install the app as an NPM library
18
+ # install the app as an NPM library. we do a global install as it saves us from issues with `$PATH`.
19
19
  RUN npm i -g aiiinotate
20
- # migrate-mongo also needs to be manually installed it seems
21
- RUN npm i -g migrate-mongo@^12.1.3
22
20
 
23
21
  # expose the used port
24
22
  EXPOSE $PORT
package/docker/README.md CHANGED
@@ -48,3 +48,15 @@ Check running ports in the Web container:
48
48
  ```bash
49
49
  sudo docker exec -it docker-web-1 ss -tnl
50
50
  ```
51
+
52
+ View globally installed NPM packages in the Web container:
53
+
54
+ ```bash
55
+ sudo docker exec -it docker-web-1 npm list -g --depth=0
56
+ ```
57
+
58
+ CURL the Web container
59
+
60
+ ```bash
61
+ sudo docker exec -it docker-web-1 curl http://0.0.0.0:4444 # change 4444 by your $APP_PORT
62
+ ```
@@ -23,7 +23,7 @@ services:
23
23
  env_file:
24
24
  - ../config/.env
25
25
  ports:
26
- - 4444:4444
26
+ - "${APP_PORT}:${APP_PORT}"
27
27
  depends_on:
28
28
  - mongo
29
29
  networks:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiiinotate",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "a fast IIIF-compliant annotation server",
5
5
  "main": "./cli/index.js",
6
6
  "type": "module",
package/src/server.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import build from "#src/app.js";
6
+ import { visibleLog } from "#utils/utils.js";
6
7
 
7
8
  /**
8
9
  * @param {import("#types").RerveModeType} serveMode
@@ -14,6 +15,8 @@ async function server (serveMode) {
14
15
 
15
16
  const fastify = await build(serveMode);
16
17
 
18
+ visibleLog([process.env.APP_HOST, process.env.APP_PORT]);
19
+
17
20
  try {
18
21
  fastify.listen({ port: process.env.APP_PORT, host: process.env.APP_HOST });
19
22
  } catch(err) {
@@ -1 +0,0 @@
1
- cd .. && sudo docker build -f ./docker/Dockerfile -t aiiinotate . --build-arg port=4444 --no-cache