``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:
40
002_source/cms/.dockerignore
Normal file
40
002_source/cms/.dockerignore
Normal 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
|
@@ -4,11 +4,14 @@ 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 && pnpm i
|
||||
RUN cd /app && pnpm run build
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy your application code (optional, comment out if not needed)
|
||||
# COPY . .
|
||||
|
||||
# Default command (optional)
|
||||
CMD ["node"]
|
||||
CMD ["./scripts/docker/entrypoint.sh"]
|
||||
|
@@ -10,7 +10,10 @@
|
||||
"dev": "next dev -H 0.0.0.0",
|
||||
"build": "next 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:fix": "next lint --fix",
|
||||
"lint:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 5 --exec \"pnpm run lint\"",
|
||||
@@ -117,4 +120,4 @@
|
||||
"protobufjs"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,9 +4,10 @@ set -ex
|
||||
|
||||
reset
|
||||
|
||||
rm -rf .next
|
||||
# rm -rf .next
|
||||
|
||||
# pnpm run typecheck
|
||||
# pnpm run lint:w
|
||||
# pnpm run lint
|
||||
|
||||
# echo "check ok"
|
||||
pnpm run build
|
||||
|
@@ -1,22 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# set -x
|
||||
|
||||
# nvm use 20
|
||||
# pnpm run build
|
||||
|
||||
pnpm i
|
||||
|
||||
pnpm run build
|
||||
|
||||
echo "build done"
|
||||
set -x
|
||||
|
||||
while true; do
|
||||
pnpm run start
|
||||
|
||||
echo "server restarted"
|
||||
echo "command restarted"
|
||||
|
||||
sleep 5
|
||||
|
||||
sleep 3
|
||||
done
|
||||
|
||||
# pnpm i -D
|
||||
|
@@ -1,6 +1,10 @@
|
||||
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 pb = new PocketBase(process.env.NEXT_PUBLIC_POCKETBASE_URL);
|
||||
|
Reference in New Issue
Block a user