``update Add Docker build and deployment workflow for CMS and Ionic Mobile, update docker-compose.yml with new service images, and enhance documentation with strategy diagram and endpoint table``

This commit is contained in:
2025-05-24 08:21:33 +08:00
parent 1157bf0fda
commit cb8643b405
16 changed files with 462 additions and 85 deletions

View File

@@ -6,6 +6,22 @@ tags: docker
docker and public endpoint docker and public endpoint
## strategy
```mermaid
graph LR
A["next build"]
B["docker build"]
A --> B --> deploy --> run
```
1. build on develop machine
1. docker build on develop machine (include source code)
1. push image to production machine
1. run image to production machine
## endpoint table
| function | address | | | function | address | |
| -------- | ---------------------------- | ---- | | -------- | ---------------------------- | ---- |
| DB | demo_ls_db.louislabs.com | 3013 | | DB | demo_ls_db.louislabs.com | 3013 |

View File

@@ -2,3 +2,5 @@
**/*.log **/*.log
**/_archive **/_archive
**/_del **/_del
**/*copy*

View File

@@ -0,0 +1,40 @@
# Ignore all files and directories by default
-
# Except for the following:
!.dockerignore
!.gitignore
!.env.example
!.git/
!.env
!.vscode/
!.idea/
# Node.js specific
node_modules/
# Build artifacts
dist/
build/
# Logs
logs/
\*.log
# Environment files
.env\*
# Cache files
\*.cache
# OS generated files
.DS_Store
Thumbs.db

View File

@@ -4,11 +4,14 @@ FROM node:22-slim
# Install pnpm globally # Install pnpm globally
RUN npm install -g pnpm RUN npm install -g pnpm
# Copy your application code (optional, comment out if not needed)
COPY . /app
RUN cd /app && pnpm i
RUN cd /app && pnpm run build
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# Copy your application code (optional, comment out if not needed)
# COPY . .
# Default command (optional) # Default command (optional)
CMD ["node"] CMD ["./scripts/docker/entrypoint.sh"]

View File

@@ -10,7 +10,10 @@
"dev": "next dev -H 0.0.0.0", "dev": "next dev -H 0.0.0.0",
"build": "next build", "build": "next build",
"build:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 15 --exec \"pnpm run build\"", "build:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 15 --exec \"pnpm run build\"",
"start": "next start", "docker:push": "docker push 192.168.10.61:5000/demo_ls_cms ",
"docker:build": "docker build -t 192.168.10.61:5000/demo_ls_cms .",
"build:docker": "pnpm run build && pnpm run docker:build && pnpm run docker:push",
"start": "next start -H 0.0.0.0",
"lint": "next lint --quiet", "lint": "next lint --quiet",
"lint:fix": "next lint --fix", "lint:fix": "next lint --fix",
"lint:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 5 --exec \"pnpm run lint\"", "lint:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 5 --exec \"pnpm run lint\"",

View File

@@ -4,9 +4,10 @@ set -ex
reset reset
rm -rf .next # rm -rf .next
# pnpm run typecheck # pnpm run typecheck
# pnpm run lint:w # pnpm run lint
# echo "check ok"
pnpm run build pnpm run build

View File

@@ -1,22 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# set -x set -x
# nvm use 20
# pnpm run build
pnpm i
pnpm run build
echo "build done"
while true; do while true; do
pnpm run start pnpm run start
echo "server restarted" echo "command restarted"
sleep 5
sleep 3
done done
# pnpm i -D # pnpm i -D

View File

@@ -1,6 +1,10 @@
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
if (!process.env.NEXT_PUBLIC_POCKETBASE_URL) throw new Error('the pocketbase url cannot empty'); if (process.env.NEXT_PUBLIC_POCKETBASE_URL) {
console.log(process.env.NEXT_PUBLIC_POCKETBASE_URL);
} else {
throw new Error('the pocketbase url cannot empty');
}
export const POCKETBASE_URL: string = process.env.NEXT_PUBLIC_POCKETBASE_URL; export const POCKETBASE_URL: string = process.env.NEXT_PUBLIC_POCKETBASE_URL;
export const pb = new PocketBase(process.env.NEXT_PUBLIC_POCKETBASE_URL); export const pb = new PocketBase(process.env.NEXT_PUBLIC_POCKETBASE_URL);

View File

@@ -2,7 +2,7 @@
services: services:
cms: cms:
image: 192.168.10.61:5000/demo_cms_ubuntu image: 192.168.10.61:5000/demo_ls_cms
build: ../cms build: ../cms
env_file: env_file:
- .env - .env
@@ -89,33 +89,32 @@ services:
# reservations: # reservations:
# cpus: 0.01 # cpus: 0.01
# ionic_mobile: ionic_mobile:
# # image: node:20-bullseye-slim # image: node:20-bullseye-slim
# image: 192.168.10.61:5000/demo_ionic_mobile image: 192.168.10.61:5000/demo_ionic_mobile
# build: ../ionic_mobile build: ../ionic_mobile
# # user: 1000:1000 # user: 1000:1000
# env_file: env_file:
# - .env - .env
# volumes: volumes:
# - ../ionic_mobile:/app - ../ionic_mobile:/app
# ports: ports:
# - 3012:5173 - 3012:8080
# - 8081:8080 working_dir: /app
# working_dir: /app command: /app/scripts/docker/entrypoint.sh
# command: /app/scripts/docker/entrypoint.sh depends_on:
# depends_on: pocketbase:
# pocketbase: condition: service_healthy
# condition: service_healthy healthcheck:
# healthcheck: #optional (recommended) since v0.10.0
# #optional (recommended) since v0.10.0 test: wget --no-verbose --tries=1 --spider http://localhost:5173 || exit 1
# test: wget --no-verbose --tries=1 --spider http://localhost:5173 || exit 1 interval: 5s
# interval: 5s timeout: 5s
# timeout: 5s retries: 5
# retries: 5
# deploy: deploy:
# resources: resources:
# limits: limits:
# cpus: '0.5' cpus: '0.5'
# reservations: reservations:
# cpus: '0.01' cpus: '0.01'

View File

@@ -0,0 +1,40 @@
# Ignore all files and directories by default
-
# Except for the following:
!.dockerignore
!.gitignore
!.env.example
!.git/
!.env
!.vscode/
!.idea/
# Node.js specific
node_modules/
# Build artifacts
dist/
build/
# Logs
logs/
\*.log
# Environment files
.env\*
# Cache files
\*.cache
# OS generated files
.DS_Store
Thumbs.db

View File

@@ -1,5 +1,17 @@
FROM 192.168.10.61:5000/nvm_ubuntu:latest # Use official Node 18 base image
FROM node:22-slim
# Install pnpm globally
RUN npm install -g pnpm
# Copy your application code (optional, comment out if not needed)
COPY . /app
RUN cd /app && npm i
RUN cd /app && npm run build
# Set working directory
WORKDIR /app WORKDIR /app
RUN nvm install 22 # Default command (optional)
CMD ["./scripts/docker/entrypoint.sh"]

View File

@@ -28,6 +28,7 @@
"@types/react-router": "^5.1.20", "@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"axios": "^1.8.1", "axios": "^1.8.1",
"http-serve": "^1.0.1",
"i18next": "^24.2.0", "i18next": "^24.2.0",
"ionicons": "^7.0.0", "ionicons": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
@@ -5815,6 +5816,15 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
"integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==",
"license": "MIT",
"engines": {
"node": ">=0.1.90"
}
},
"node_modules/combined-stream": { "node_modules/combined-stream": {
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -6653,6 +6663,15 @@
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/corser": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
"integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==",
"license": "MIT",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/create-require": { "node_modules/create-require": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
@@ -7383,6 +7402,22 @@
"safer-buffer": "^2.1.0" "safer-buffer": "^2.1.0"
} }
}, },
"node_modules/ecstatic": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-2.2.2.tgz",
"integrity": "sha512-F1g29y3I+abOS+M0AiK2O9R96AJ49Bc3kH696HtqnN+CL3YhpUnSzHNoUBQL03qDsN9Lr1XeKIxTqEH3BtiBgg==",
"deprecated": "This package is unmaintained and deprecated. See the GH Issue 259.",
"license": "MIT",
"dependencies": {
"he": "^1.1.1",
"mime": "^1.2.11",
"minimist": "^1.1.0",
"url-join": "^2.0.2"
},
"bin": {
"ecstatic": "lib/ecstatic.js"
}
},
"node_modules/ee-first": { "node_modules/ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -8037,6 +8072,12 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"license": "MIT"
},
"node_modules/eventsource": { "node_modules/eventsource": {
"version": "3.0.7", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
@@ -9681,7 +9722,6 @@
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
"dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"he": "bin/he" "he": "bin/he"
@@ -9814,6 +9854,20 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"license": "MIT",
"dependencies": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/http-proxy-agent": { "node_modules/http-proxy-agent": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
@@ -9829,6 +9883,26 @@
"node": ">= 6" "node": ">= 6"
} }
}, },
"node_modules/http-serve": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/http-serve/-/http-serve-1.0.1.tgz",
"integrity": "sha512-dlIVvTQitN2q/KX9s3r2flAiByI3jqjoIoJ90Qtin+u9m7oWNM88qjwrNxeEVfsI+AE3bQAAdC73WE/0RtnVaQ==",
"license": "MIT",
"dependencies": {
"colors": "1.0.3",
"corser": "~2.0.0",
"ecstatic": "^2.0.0",
"http-proxy": "^1.8.1",
"opener": "~1.4.0",
"optimist": "0.6.x",
"portfinder": "0.4.x",
"union": "~0.4.3"
},
"bin": {
"hs": "bin/http-serve",
"http-serve": "bin/http-serve"
}
},
"node_modules/http-signature": { "node_modules/http-signature": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz",
@@ -12461,6 +12535,18 @@
"node": ">=8.6" "node": ">=8.6"
} }
}, },
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"license": "MIT",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/mime-db": { "node_modules/mime-db": {
"version": "1.52.0", "version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
@@ -12532,7 +12618,6 @@
"version": "1.2.8", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@@ -13074,6 +13159,40 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/opener": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz",
"integrity": "sha512-4Im9TrPJcjAYyGR5gBe3yZnBzw5n3Bfh1ceHHGNOpMurINKc6RdSIPXMyon4BZacJbJc36lLkhipioGbWh5pwg==",
"license": "(WTFPL OR MIT)",
"bin": {
"opener": "opener.js"
}
},
"node_modules/optimist": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==",
"license": "MIT/X11",
"dependencies": {
"minimist": "~0.0.1",
"wordwrap": "~0.0.2"
}
},
"node_modules/optimist/node_modules/minimist": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==",
"license": "MIT"
},
"node_modules/optimist/node_modules/wordwrap": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
"integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==",
"license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/optionator": { "node_modules/optionator": {
"version": "0.9.4", "version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@@ -13454,6 +13573,36 @@
"integrity": "sha512-WBBeOgz4Jnrd7a1KEzSBUJqpTortKKCcp16j5KoF+4tNIyQHsmynj+qRSvS56/RVacVMbAqO8Qkfj3N84fpzEw==", "integrity": "sha512-WBBeOgz4Jnrd7a1KEzSBUJqpTortKKCcp16j5KoF+4tNIyQHsmynj+qRSvS56/RVacVMbAqO8Qkfj3N84fpzEw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/portfinder": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-0.4.0.tgz",
"integrity": "sha512-SZ3hp61WVhwNSS0gf0Fdrx5Yb/wl35qisHuPVM1S0StV8t5XlVZmmJy7/417OELJA7t6ecEmeEzvOaBwq3kCiQ==",
"license": "MIT/X11",
"dependencies": {
"async": "0.9.0",
"mkdirp": "0.5.x"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/portfinder/node_modules/async": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
"integrity": "sha512-XQJ3MipmCHAIBBMFfu2jaSetneOrXbSyyqeU3Nod867oNOpS+i9FEms5PWgjMxSgBybRf2IVVLtr1YfrDO+okg=="
},
"node_modules/portfinder/node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"license": "MIT",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/possible-typed-array-names": { "node_modules/possible-typed-array-names": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
@@ -14804,7 +14953,6 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/resize-observer-polyfill": { "node_modules/resize-observer-polyfill": {
@@ -16887,6 +17035,22 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/union": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz",
"integrity": "sha512-2qtrvSgD0GKotLRCNYkIMUOzoaHjXKCtbAP0kc5Po6D+RWTBb+BxlcHlHCYcf+Y+YM7eQicPgAg9mnWQvtoFVA==",
"dependencies": {
"qs": "~2.3.3"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/union/node_modules/qs": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz",
"integrity": "sha512-f5M0HQqZWkzU8GELTY8LyMrGkr3bPjKoFtTkwUEqJQbcljbeK8M7mliP9Ia2xoOI6oMerp+QPS7oYJtpGmWe/A=="
},
"node_modules/unique-string": { "node_modules/unique-string": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
@@ -17039,6 +17203,12 @@
"punycode": "^2.1.0" "punycode": "^2.1.0"
} }
}, },
"node_modules/url-join": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
"integrity": "sha512-c2H1fIgpUdwFRIru9HFno5DT73Ok8hg5oOb5AT3ayIgvCRfxgs2jyt5Slw8kEB7j3QUr6yJmMPDT/odjk7jXow==",
"license": "MIT"
},
"node_modules/url-parse": { "node_modules/url-parse": {
"version": "1.5.10", "version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",

View File

@@ -3,12 +3,20 @@
"private": true, "private": true,
"version": "0.0.1", "version": "0.0.1",
"type": "module", "type": "module",
"engines": {
"node": "==22"
},
"scripts": { "scripts": {
"dev": "vite --host --cors --force --strictPort --clearScreen", "dev": "vite --host --cors --force --strictPort --clearScreen",
"build": "tsc && vite build && npx cap copy", "build": "tsc && vite build && npx cap copy",
"build:docker": "pnpm run build && pnpm run docker:build && pnpm run docker:push",
"build:w": "npx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 15 --exec \"pnpm run build\"",
"docker:push": "docker push 192.168.10.61:5000/demo_ionic_mobile",
"docker:build": "docker build -t 192.168.10.61:5000/demo_ionic_mobile .",
"ionic_build": "npx vite build && npx cap copy", "ionic_build": "npx vite build && npx cap copy",
"ionic_sync": "npx cap sync --inline", "ionic_sync": "npx cap sync --inline",
"ionic_pre_android_studio": "npm run ionic_build && npm run ionic_sync", "ionic_pre_android_studio": "npm run ionic_build && npm run ionic_sync",
"start": "npx http-serve dist",
"preview": "vite preview", "preview": "vite preview",
"test.e2e": "cypress run", "test.e2e": "cypress run",
"test.unit": "vitest", "test.unit": "vitest",
@@ -43,6 +51,7 @@
"@types/react-router": "^5.1.20", "@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"axios": "^1.8.1", "axios": "^1.8.1",
"http-serve": "^1.0.1",
"i18next": "^24.2.0", "i18next": "^24.2.0",
"ionicons": "^7.0.0", "ionicons": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
@@ -89,8 +98,5 @@
"vite": "~5.2.0", "vite": "~5.2.0",
"vitest": "^0.34.6" "vitest": "^0.34.6"
}, },
"description": "An Ionic project", "description": "An Ionic project"
"engines": {
"node": "==22"
}
} }

View File

@@ -1,19 +1,27 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -x
nvm use 22 while true; do
node -v npm run start
echo "command restarted"
sleep 5
done
# sleep infinity # sleep infinity
while true; do
if [ "$NODE_ENV" = "development" ]; then
npm i -D
npm run dev
else
# temp solution
npm run dev
fi
sleep 1 # # sleep infinity
done # while true; do
# if [ "$NODE_ENV" = "development" ]; then
# npm i -D
# npm run dev
# else
# # temp solution
# npm run dev
# fi
# sleep 1
# done

View File

@@ -0,0 +1,85 @@
{
"name": "lettersoup_app_poc",
"private": true,
"version": "0.0.1",
"type": "module",
"engines": {
"node": "==22"
},
"scripts": {
"dev": "vite --host --cors --force --strictPort --clearScreen",
"build:docker": "pnpm run docker:build && pnpm run docker:push",
"build:w": "not implemented",
"docker:push": "docker push 192.168.10.61:5000/demo_ls_db",
"docker:build": "docker build --build-arg VERSION=0.26.6 -t 192.168.10.61:5000/demo_ls_db ./docker"
},
"dependencies": {
"@capacitor/android": "^6.2.0",
"@capacitor/app": "6.0.2",
"@capacitor/core": "6.2.0",
"@capacitor/filesystem": "^6.0.2",
"@capacitor/haptics": "6.0.2",
"@capacitor/keyboard": "6.0.3",
"@capacitor/splash-screen": "^6.0.3",
"@capacitor/status-bar": "6.0.2",
"@hookform/resolvers": "3.3.4",
"@ionic/prettier-config": "^4.0.0",
"@ionic/react": "^8.0.0",
"@ionic/react-router": "^8.0.0",
"@ionic/storage": "^4.0.0",
"@lifeomic/attempt": "^3.1.0",
"@tanstack/react-query": "^5.74.4",
"@tanstack/react-query-devtools": "^5.74.6",
"@types/lodash": "^4.17.16",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"axios": "^1.8.1",
"http-serve": "^1.0.1",
"i18next": "^24.2.0",
"ionicons": "^7.0.0",
"lodash": "^4.17.21",
"pocketbase": "^0.26.0",
"qr-code-styling": "^1.9.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "7.50.1",
"react-i18next": "^15.2.0",
"react-markdown": "^9.0.3",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-use": "^17.6.0",
"react-use-audio-player": "^2.3.0-alpha.1",
"remark-gfm": "^4.0.0",
"zod": "3.22.4"
},
"devDependencies": {
"@capacitor/assets": "^3.0.5",
"@capacitor/cli": "6.2.0",
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
"@testing-library/dom": ">=7.21.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.4.3",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-legacy": "^5.0.0",
"@vitejs/plugin-react": "^4.0.1",
"cypress": "^13.5.0",
"eslint": "^9.20.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"jsdom": "^22.1.0",
"prettier": "^3.4.2",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-unused-imports-configurable": "^1.14.2",
"sass": "^1.88.0",
"terser": "^5.4.0",
"typescript": "^5.1.6",
"typescript-eslint": "^8.24.0",
"vite": "~5.2.0",
"vitest": "^0.34.6"
},
"description": "An Ionic project"
}

View File

@@ -2,19 +2,15 @@
set -ex set -ex
# docker compose build # DOCKER_COMPOSE_FILES="-f docker-compose.db.yml"
DOCKER_COMPOSE_FILES="-f ./docker-compose.db.yml -f ./docker-compose.yml"
# cd cms cd docker
# # nvm use 18 docker compose $DOCKER_COMPOSE_FILES build
# npm run build docker compose $DOCKER_COMPOSE_FILES up -d
# cd -
# cd ionic_mobile docker compose $DOCKER_COMPOSE_FILES exec -it cms bash
# npm run build cd ..
# cd -
docker compose up -d
docker compose logs -f
echo "done" echo "done"