mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-01 11:22:34 +02:00
Reduce Docker size
This commit is contained in:
parent
e6915d8964
commit
92da0a444d
3 changed files with 48 additions and 14 deletions
|
@ -1,14 +1,35 @@
|
||||||
/.idea
|
/.idea
|
||||||
/dist
|
/dist
|
||||||
/node_modules
|
/node_modules
|
||||||
/data/kuma.db
|
/data
|
||||||
/.do
|
/.do
|
||||||
**/.dockerignore
|
**/.dockerignore
|
||||||
**/.git
|
**/.git
|
||||||
**/.gitignore
|
**/.gitignore
|
||||||
**/docker-compose*
|
**/docker-compose*
|
||||||
**/Dockerfile*
|
**/[Dd]ockerfile*
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
.editorconfig
|
.editorconfig
|
||||||
.vscode
|
.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
|
||||||
|
|
17
dockerfile
17
dockerfile
|
@ -1,5 +1,5 @@
|
||||||
# DON'T UPDATE TO alpine3.13, 1.14, see #41.
|
# 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
|
WORKDIR /app
|
||||||
|
|
||||||
# split the sqlite install here, so that it can caches the arm prebuilt
|
# split the sqlite install here, so that it can caches the arm prebuilt
|
||||||
|
@ -28,14 +28,27 @@ RUN apprise --version
|
||||||
|
|
||||||
# New things add here
|
# New things add here
|
||||||
|
|
||||||
|
FROM release-base AS build
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM release-base AS release-final
|
||||||
|
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
VOLUME ["/app/data"]
|
VOLUME ["/app/data"]
|
||||||
HEALTHCHECK --interval=60s --timeout=30s --start-period=300s CMD node extra/healthcheck.js
|
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"]
|
CMD ["npm", "run", "start-server"]
|
||||||
|
|
||||||
FROM release AS nightly
|
FROM release-final AS nightly
|
||||||
RUN npm run mark-as-nightly
|
RUN npm run mark-as-nightly
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { defineConfig } from 'vite'
|
import legacy from "@vitejs/plugin-legacy"
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from "@vitejs/plugin-vue"
|
||||||
import legacy from '@vitejs/plugin-legacy'
|
import { defineConfig } from "vite"
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
legacy({
|
legacy({
|
||||||
targets: ['ie > 11'],
|
targets: ["ie > 11"],
|
||||||
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
|
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
|
||||||
})
|
}),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue