mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-09-19 10:11:36 +08:00
build(docker): add log rotation to compose and simplify vite build scripts
This commit is contained in:
@@ -22,8 +22,8 @@ services:
|
||||
image: registry.cn-beijing.aliyuncs.com/dc3/dc3-web:2024.1.1.dev
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
- 443:443
|
||||
- '8080:80'
|
||||
- '443:443'
|
||||
environment:
|
||||
- APP_API_HOST=dc3-gateway
|
||||
- APP_API_PORT=8000
|
||||
@@ -31,6 +31,11 @@ services:
|
||||
hostname: dc3-web
|
||||
volumes:
|
||||
- nginx:/var/log/nginx
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: '20m'
|
||||
max-file: '20'
|
||||
networks:
|
||||
dc3net:
|
||||
aliases:
|
||||
@@ -41,5 +46,5 @@ volumes:
|
||||
|
||||
networks:
|
||||
dc3net:
|
||||
driver: 'bridge'
|
||||
driver: bridge
|
||||
...
|
||||
|
||||
+3
-5
@@ -10,12 +10,10 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"serve": "vite --host --mode dev",
|
||||
"test": "vite --host --mode test",
|
||||
"pre": "vite --host --mode pre",
|
||||
"build": "vite build --mode pro",
|
||||
"build:dev": "vite build --mode dev",
|
||||
"build:mock": "vite build --mode mock",
|
||||
"build:test": "vite build --mode test",
|
||||
"build:pre": "vite build --mode pre",
|
||||
"pro": "vite --host --mode pro",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "vue-tsc --build --force",
|
||||
"format": "prettier --write src/",
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import Components from 'unplugin-vue-components/vite'
|
||||
import { ConfigEnv, defineConfig } from 'vite'
|
||||
|
||||
export default (configEnv: ConfigEnv) => {
|
||||
process.env.NODE_ENV = configEnv.mode || 'dev'
|
||||
process.env.NODE_ENV = configEnv.mode == 'production' ? 'pro' : configEnv.mode || 'dev'
|
||||
|
||||
const envDir = './src/config/env'
|
||||
const files = [`${envDir}/.env`, `${envDir}/.env.${process.env.NODE_ENV}`]
|
||||
|
||||
Reference in New Issue
Block a user