Commit 43ba411f by xiawei

ali-oss

parent 59699d9f
......@@ -12,7 +12,6 @@ WORKDIR /var/www/web_live
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn cross-env run_server=production nuxt build
RUN yarn cross-env run_server=production node upload.js
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml pDockerfile README.md pStart.sh
EXPOSE 3000
RUN chmod +x start.sh
......
const { version } = require('./package.json');
const WebpackAliOSSPlugin = require('@gdyfe/webpack-alioss-plugin');
const format = WebpackAliOSSPlugin.getFormat('YYMMDD');
const BASE_URL = '/live/';
const globalEnv = require('./config/global.js');
const modeEnv = process.env.mode ? require(`./config/${process.env.mode}.js`) : {};
......@@ -104,13 +105,25 @@ export default {
*/
// publicPath: `/${BUILD_DIST.toLowerCase()}/`,
publicPath: process.env.run_server
? `//static-${process.env.run_server}.guangdianyun.tv/live/${version}`
? `//static-${process.env.run_server}.guangdianyun.tv/live/${format}`
: `/${BUILD_DIST.toLowerCase()}/`,
extend(config, ctx) {
// console.log(ctx);
},
analyze: false,
maxChunkSize: 300000,
plugins: []
plugins: [
new WebpackAliOSSPlugin({
accessKeyId: 'LTAIIgVna8MHelpI',
accessKeySecret: 'fqQNjEGxww3ZZJ9GbUfNp2yzsWUcnl',
bucket: `guangdianyun-static-${process.env.run_server}`,
region: 'oss-cn-hangzhou',
prefix: 'live',
output: './nuxt-dist/dist/client',
local: true,
limit: 10,
format
})
]
}
};
......@@ -28,6 +28,7 @@
"dependencies": {
"@gdyfe/ink-marks": "^1.1.0",
"@gdyfe/uploader": "^2.0.3",
"@gdyfe/webpack-alioss-plugin": "^0.1.2",
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/component-cache": "^1.1.5",
"@nuxtjs/router": "^1.5.0",
......
......@@ -885,6 +885,16 @@
dayjs "^1.9.1"
object-hash "^2.0.3"
"@gdyfe/webpack-alioss-plugin@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@gdyfe/webpack-alioss-plugin/-/webpack-alioss-plugin-0.1.2.tgz#55eccd7172503f704a19ca93307dba136f2e0245"
integrity sha512-qbj3dmBry7ZPkxPI+vHPcDZwcT/tO3JO02QkrSCSeYf8nN7K4ofLwXTZKPJzxLwzZIW37du5Dm4AD94xEYbgfg==
dependencies:
ali-oss "^6.11.2"
ansi-colors "^4.1.1"
fancy-log "^1.3.3"
progress "^2.0.3"
"@nodelib/fs.scandir@2.1.3":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
......@@ -1812,7 +1822,7 @@ ali-oss@^6.10.0:
utility "^1.8.0"
xml2js "^0.4.16"
ali-oss@^6.11.1:
ali-oss@^6.11.1, ali-oss@^6.11.2:
version "6.11.2"
resolved "https://registry.yarnpkg.com/ali-oss/-/ali-oss-6.11.2.tgz#fed279a9d373f0d1ad278edf614f710f99f73e19"
integrity sha512-rNeYm5yogNOABCY9G27RgB6BGJ0BK+nQGicfDXKp1Fq7G/eJMZYwBNXdM420uAIUoMM81uFOtSIRYBRF6IxPwA==
......@@ -1866,6 +1876,11 @@ ansi-colors@^3.0.0:
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf"
integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==
ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
ansi-escapes@^4.2.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61"
......@@ -1873,6 +1888,13 @@ ansi-escapes@^4.2.1:
dependencies:
type-fest "^0.11.0"
ansi-gray@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251"
integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE=
dependencies:
ansi-wrap "0.1.0"
ansi-html@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e"
......@@ -1918,6 +1940,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
"@types/color-name" "^1.1.1"
color-convert "^2.0.1"
ansi-wrap@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768=
any-promise@^1.0.0, any-promise@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
......@@ -2792,6 +2819,11 @@ color-string@^1.5.2:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color-support@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==
color@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/color/-/color-3.1.2.tgz#68148e7f85d41ad7649c5fa8c8106f098d229e10"
......@@ -4196,6 +4228,16 @@ extract-css-chunks-webpack-plugin@^4.7.5:
webpack-external-import "^2.2.4"
webpack-sources "^1.1.0"
fancy-log@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7"
integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==
dependencies:
ansi-gray "^0.1.1"
color-support "^1.1.3"
parse-node-version "^1.0.0"
time-stamp "^1.0.0"
fast-deep-equal@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
......@@ -6634,6 +6676,11 @@ parse-json@^4.0.0:
error-ex "^1.3.1"
json-parse-better-errors "^1.0.1"
parse-node-version@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b"
integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==
parse-path@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.2.tgz#ef14f0d3d77bae8dd4bc66563a4c151aac9e65aa"
......@@ -8827,6 +8874,11 @@ time-fix-plugin@^2.0.6:
resolved "https://registry.yarnpkg.com/time-fix-plugin/-/time-fix-plugin-2.0.6.tgz#3210121d269b475a7e7661766e682bd768ba1ced"
integrity sha512-2cjjg3672ppNm/uKhHAoCFp1ItEAiH+xJOjO9WGIF8hXuxPAJ2adfYgFiyooVbsOb948c+WrRh+edxFUMxYHoQ==
time-stamp@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3"
integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=
timers-browserify@^2.0.4:
version "2.0.11"
resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.11.tgz#800b1f3eee272e5bc53ee465a04d0e804c31211f"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment