Reduce Docker size

This commit is contained in:
Adam Stachowicz 2021-07-29 01:38:45 +02:00
parent e6915d8964
commit 92da0a444d
3 changed files with 48 additions and 14 deletions

View file

@ -1,14 +1,35 @@
/.idea
/dist
/node_modules
/data/kuma.db
/data
/.do
**/.dockerignore
**/.git
**/.gitignore
**/docker-compose*
**/Dockerfile*
**/[Dd]ockerfile*
LICENSE
README.md
.editorconfig
.vscode
.eslint*
.stylelint*
/.github
package-lock.json
yarn.lock
app.json
### .gitignore content (commented rules are duplicated)
#node_modules
.DS_Store
#dist
dist-ssr
*.local
#.idea
#/data
#!/data/.gitkeep
#.vscode
### End of .gitignore content

View file

@ -1,5 +1,5 @@
# DON'T UPDATE TO alpine3.13, 1.14, see #41.
FROM node:14-alpine3.12 AS release
FROM node:14-alpine3.12 AS release-base
WORKDIR /app
# split the sqlite install here, so that it can caches the arm prebuilt
@ -28,14 +28,27 @@ RUN apprise --version
# New things add here
FROM release-base AS build
COPY . .
RUN npm install
RUN npm run build
FROM release-base AS release-final
EXPOSE 3001
VOLUME ["/app/data"]
HEALTHCHECK --interval=60s --timeout=30s --start-period=300s CMD node extra/healthcheck.js
COPY --from=build /app/package.json package.json
RUN npm install --only=prod
RUN rm package-lock.json
COPY --from=build /app/extra /app/extra
COPY --from=build /app/server /app/server
COPY --from=build /app/dist /app/dist
CMD ["npm", "run", "start-server"]
FROM release AS nightly
FROM release-final AS nightly
RUN npm run mark-as-nightly

View file

@ -1,14 +1,14 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import legacy from '@vitejs/plugin-legacy'
import legacy from "@vitejs/plugin-legacy"
import vue from "@vitejs/plugin-vue"
import { defineConfig } from "vite"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
legacy({
targets: ['ie > 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
})
]
plugins: [
vue(),
legacy({
targets: ["ie > 11"],
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
}),
],
})