build scheme

This commit is contained in:
Zhanpeng Yang 2024-09-12 18:48:25 +08:00
parent 8bc281423e
commit 6d3b3435fe
7 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,11 @@
# 更新日志
## v0.0.1.20240912_base
### ⭐Features
- 研究部署方案最终采用开发环境编译然后脚本打包然后使用同一个docker环境部署的方案。详见README.md
## v0.0.1.20240905_base
### ⭐Features

View File

@ -1,10 +1,10 @@
FROM docker.io/library/node:20.17.0-alpine3.19
FROM node:20.17.0-alpine3.19
WORKDIR /env
COPY package.json ./
RUN npm config set registry https://registry.npmmirror.com &&\
npm install
npm install &&\
npm cache clean --force
WORKDIR /app

View File

@ -4,4 +4,9 @@ First, run the development server:
```bash
docker compose up
```
```
发布:
1. 在docker环境内编译npm run build
2. 打包Compress-Archive -Path .next/standalone/*,.next/static -DestinationPath ./release/tmp.zip
3. 运行 docker run -p 4000:3000 -v C:\SEMS-development\SEMS-on-device-server\release:/app sems-on-device-server-server:latest sh -c 'ln -snf /env/node_modules /app && npm run start'

View File

@ -1,7 +1,7 @@
services:
server:
build: ./
container_name: sccs_loca_server
container_name: sems_on_device_server
ports:
- 3000:3000
volumes:

View File

@ -6,7 +6,7 @@
"scripts": {
"dev": "nodemon",
"build": "next build",
"start": "NODE_ENV=production node server.js",
"start": "NODE_ENV=production node server.js",
"lint": "next lint"
},
"dependencies": {

View File

@ -40,7 +40,7 @@ app.prepare().then(() => {
});
const forked = fork("./src/lib/scanner.js")
const forked = fork("./scanner.js")
forked.on("message", msg => {
console.log("received",msg)