added multistage build for docker

main
Johannes Bülow 2023-03-10 15:40:25 +01:00
parent 9e2c372956
commit f1cdbe3c43
Signed by untrusted user who does not match committer: jmb
GPG Key ID: B56971CF7B8F83A6
4 changed files with 14 additions and 3 deletions

9
Dockerfile.multistage Normal file
View File

@ -0,0 +1,9 @@
FROM node:latest AS builder
WORKDIR /var/build/
COPY ./ /var/build/
RUN npm install
RUN npm run build
FROM nginx:alpine
COPY --from=builder /var/build/dist /usr/share/nginx/html

View File

@ -29,3 +29,6 @@ clean:
rm -f $(CURDIR)/src/lib/crypttool.wasm rm -f $(CURDIR)/src/lib/crypttool.wasm
rm -rf $(CURDIR)/node_modules/* rm -rf $(CURDIR)/node_modules/*
rm -rf $(CURDIR)/dist rm -rf $(CURDIR)/dist
rm -rf $(CURDIR)/.yarn
rm -rf $(CURDIR)/package-lock.json
rm -rf $(CURDIR)/yarn.lock

View File

@ -30,7 +30,7 @@
<p class="read-the-docs"> <p class="read-the-docs">
You can drag and drop a file on the "Encrypt" Button to encrypt it with a randomly generated password, and decrypt a file encrypted with this tool. You can drag and drop a file on the "Encrypt" Button to encrypt it with a randomly generated password, and decrypt a file encrypted with this tool.
For more information check out the Documentation. For more information check out the <a href="https://codeberg.org/jmbit/crypttool/src/branch/main/docs/index.md">Documentation</a>.
</p> </p>
<Footer/> <Footer/>

View File

@ -1,9 +1,8 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte'; import { svelte } from '@sveltejs/vite-plugin-svelte';
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await"; import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [svelte(), wasm(), topLevelAwait()], plugins: [svelte(), topLevelAwait()],
}) })