svelte dockerfile

This commit is contained in:
Maxime Cannoodt 2022-06-30 22:08:52 +02:00
parent 67a6cb5f23
commit 2a612bf0ee
5 changed files with 50 additions and 11 deletions

2
webapp/.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
npm-debug.log

24
webapp/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:16-alpine AS BUILD_IMAGE
# install dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Copy all local files into the image.
COPY . .
RUN npm run build
# remove development dependencies
RUN npm prune --production
FROM node:16-alpine
WORKDIR /app
COPY --from=0 /app .
COPY . .
EXPOSE 3000
CMD ["node", "./build"]

View File

@ -8,6 +8,7 @@
"name": "obsidian-note-sharing-server", "name": "obsidian-note-sharing-server",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"@sveltejs/adapter-node": "^1.0.0-next.78",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"katex": "^0.16.0", "katex": "^0.16.0",
"marked": "^4.0.17", "marked": "^4.0.17",
@ -209,6 +210,14 @@
"tiny-glob": "^0.2.9" "tiny-glob": "^0.2.9"
} }
}, },
"node_modules/@sveltejs/adapter-node": {
"version": "1.0.0-next.78",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-1.0.0-next.78.tgz",
"integrity": "sha512-TXB5Ii0z/7o1B05p/YLsS4t+JUHFHWBzFv1U16TKvM3HMbMUJIx+AhpM2WJfDX8HtAyfd1m9OawGoUB+1ed24A==",
"dependencies": {
"tiny-glob": "^0.2.9"
}
},
"node_modules/@sveltejs/adapter-vercel": { "node_modules/@sveltejs/adapter-vercel": {
"version": "1.0.0-next.58", "version": "1.0.0-next.58",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.58.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.58.tgz",
@ -1959,8 +1968,7 @@
"node_modules/globalyzer": { "node_modules/globalyzer": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
"dev": true
}, },
"node_modules/globby": { "node_modules/globby": {
"version": "11.1.0", "version": "11.1.0",
@ -1985,8 +1993,7 @@
"node_modules/globrex": { "node_modules/globrex": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
"dev": true
}, },
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.10", "version": "4.2.10",
@ -3871,7 +3878,6 @@
"version": "0.2.9", "version": "0.2.9",
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
"dependencies": { "dependencies": {
"globalyzer": "0.1.0", "globalyzer": "0.1.0",
"globrex": "^0.1.2" "globrex": "^0.1.2"
@ -4259,6 +4265,14 @@
"tiny-glob": "^0.2.9" "tiny-glob": "^0.2.9"
} }
}, },
"@sveltejs/adapter-node": {
"version": "1.0.0-next.78",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-1.0.0-next.78.tgz",
"integrity": "sha512-TXB5Ii0z/7o1B05p/YLsS4t+JUHFHWBzFv1U16TKvM3HMbMUJIx+AhpM2WJfDX8HtAyfd1m9OawGoUB+1ed24A==",
"requires": {
"tiny-glob": "^0.2.9"
}
},
"@sveltejs/adapter-vercel": { "@sveltejs/adapter-vercel": {
"version": "1.0.0-next.58", "version": "1.0.0-next.58",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.58.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.58.tgz",
@ -5419,8 +5433,7 @@
"globalyzer": { "globalyzer": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
"dev": true
}, },
"globby": { "globby": {
"version": "11.1.0", "version": "11.1.0",
@ -5439,8 +5452,7 @@
"globrex": { "globrex": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
"dev": true
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.10", "version": "4.2.10",
@ -6809,7 +6821,6 @@
"version": "0.2.9", "version": "0.2.9",
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
"requires": { "requires": {
"globalyzer": "0.1.0", "globalyzer": "0.1.0",
"globrex": "^0.1.2" "globrex": "^0.1.2"

View File

@ -36,6 +36,7 @@
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@sveltejs/adapter-node": "^1.0.0-next.78",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"katex": "^0.16.0", "katex": "^0.16.0",
"marked": "^4.0.17", "marked": "^4.0.17",

View File

@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-auto'; // import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-node';
import preprocess from 'svelte-preprocess'; import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */