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 +3 -5
- package/docker/README.md +12 -0
- package/docker/docker-compose.yaml +1 -1
- package/package.json +1 -1
- package/src/server.js +3 -0
- package/docker/build_dockerfile.sh +0 -1
package/docker/Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
|
-
FROM node:23.11
|
|
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
|
|
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
|
+
```
|
package/package.json
CHANGED
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
|