feat: split backend

This commit is contained in:
Mikucat 2024-02-04 16:16:55 +08:00
parent 44fa4744c2
commit b6f67f0832
No known key found for this signature in database
GPG Key ID: CE6B09A6F462E04D
3 changed files with 28 additions and 8 deletions

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM node:16-alpine AS builder
ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache git
COPY .git .git/
COPY package.json yarn.lock ./
RUN yarn install
COPY build/ build/
COPY config/ config/
COPY deploy/ deploy/
COPY src/ src/
COPY static/ static/
COPY .babelrc .postcssrc.js ./
RUN <<EOS
set -ex
yarn run build:dll
yarn run build
EOS
FROM caddy:2.7.6
WORKDIR /app
COPY --from=builder /app/dist/ ./

View File

@ -20,7 +20,7 @@ module.exports = {
adminTemplate: path.resolve(__dirname, '../src/pages/admin/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/__STATIC_CDN_HOST__/',
assetsPublicPath: '/',
productionSourceMap: process.env.USE_SENTRY === '1',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.

View File

@ -9,13 +9,6 @@
<link rel="shortcut icon" href="/public/website/favicon.ico">
<link href="/static/css/loader.css" rel="stylesheet">
<script>
// IE 10 and earlier
if (window.navigator.userAgent.indexOf('MSIE ') > 0 &&
window.confirm('Your browser is not supported, click \'OK\' to update')) {
window.location = 'http://outdatedbrowser.com'
}
</script>
</head>
<body>
<div id="app-loader">