docker: switch to bun instead of node

This commit is contained in:
Xylight committed 2024-02-10 12:55:58 -08:00
1 parent 8edceaf54f
commit 5d271b1325
4 files changed
+13 -7

No files matched your search

+5 -5
View File
@@ -1,17 +1,17 @@
FROM node:20-alpine
FROM oven/bun:alpine
WORKDIR /app
COPY package.json ./
RUN npm install
RUN bun install
EXPOSE 3000
COPY . .
RUN ADAPTER=node npm run build
RUN ADAPTER=bun bun run build
USER node
USER bun
CMD ["npm", "run", "start"]
CMD ["bun", "run", "bunstart"]
Executable
BIN
View File
Binary file not shown.
+6 -1
View File
@@ -1,6 +1,6 @@
{
"name": "photon-lemmy",
"version": "1.26.0",
"version": "1.27.0",
"private": true,
"scripts": {
"dev": "vite dev",
@@ -8,10 +8,12 @@
"test": "vitest",
"preview": "vite preview",
"start": "node build/index.js",
"bunstart": "bun build/index.js",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@catdadcode/svelte-adapter-bun": "^0.5.7",
"@sveltejs/adapter-auto": "^2.1.1",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.24.0",
@@ -46,5 +48,8 @@
"markdown-it": "^13.0.1",
"mono-svelte": "^1.4.5"
},
"overrides": {
"@rollup/plugin-node-resolve": "^15.2.3"
},
"type": "module"
}
+2 -1
View File
@@ -1,5 +1,6 @@
import auto from '@sveltejs/adapter-auto';
import node from '@sveltejs/adapter-node';
import bun from '@catdadcode/svelte-adapter-bun'
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
@@ -12,7 +13,7 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: process.env.ADAPTER == 'node' ? node() : auto(),
adapter: process.env.ADAPTER == 'node' ? node() : process.env.ADAPTER == 'bun' ? bun() : auto(),
// csp: {
// directives: {
// 'script-src': ['self'],