move back to bun, hopefully fix docker and 404

This commit is contained in:
Lio 2025-11-19 18:55:13 +01:00
parent 74416bae2d
commit 155b2bc649
8 changed files with 1927 additions and 6980 deletions

54
Dockerfile Normal file
View file

@ -0,0 +1,54 @@
# FROM oven/bun:latest as base
# WORKDIR /usr/src/app
# FROM base AS install
# RUN mkdir -p /temp/dev
# COPY package.json bun.lock /temp/dev/
# RUN cd /temp/dev && bun install --frozen-lockfile
# RUN mkdir -p /temp/prod
# COPY package.json bun.lock /temp/prod/
# RUN cd /temp/prod && bun install --frozen-lockfile --production
# FROM base AS build
# COPY --from=install /temp/dev/node_modules node_modules
# COPY . .
# RUN bun run build
# FROM base AS release
# COPY --from=base /app/package.json /app/bun.lock ./
# COPY --from=install /temp/prod/node_modules node_modules
# COPY --from=build /usr/src/app/dist .
# EXPOSE 4321
# ENTRYPOINT [ "bun", "run", "start" ]
FROM oven/bun:latest AS base
WORKDIR /app
FROM base AS deps
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
FROM base AS build
COPY --from=deps /app/node_modules node_modules
COPY . .
RUN bun run build
FROM base AS release
COPY --from=deps /app/node_modules node_modules
COPY --from=build /app/dist ./dist
COPY package.json bun.lock ./
EXPOSE 4321
ENTRYPOINT [ "bun", "run", "start" ]
# ENTRYPOINT [ "sleep", "infinity" ]
# COPY . .
# RUN bun install
# RUN bun run build
# EXPOSE 4321
# ENTRYPOINT [ "bun", "run", "start" ]

View file

@ -9,18 +9,16 @@ import { defineConfig } from "astro/config"
import robotsTxt from "astro-robots-txt"
import addClasses from "rehype-class-names"
// import remarkRehype from "remark-rehype"
import og from "astro-og";
import bun from "@hedystia/astro-bun";
import node from "@astrojs/node";
// https://astro.build/config
export default defineConfig({
output: "server",
adapter: bun(),
output: "server",
prefetch: true,
site: "https://lio.cat",
markdown: {
remarkRehype: {},
rehypePlugins: [
@ -45,8 +43,4 @@ export default defineConfig({
showLineNumbers: true,
},
}), mdx({}), robotsTxt(), og()],
adapter: node({
mode: "standalone",
}),
})

1851
bun.lock Normal file

File diff suppressed because it is too large Load diff

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
services:
app:
build:
context: .
target: release
ports:
- "4321:4321"
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 4321
restart: unless-stopped

View file

@ -5,29 +5,28 @@
"scripts": {
"dev": "astro dev --host 0.0.0.0",
"build": "astro check && astro build",
"check": "astro check",
"preview": "astro preview",
"astro": "astro",
"format": "prettier --write .",
"start": "HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs"
"start": "bun run ./dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/check": "^0.9.5",
"@astrojs/mdx": "^4.3.11",
"@astrojs/node": "^9.5.1",
"@astrojs/react": "^4.4.2",
"@astrojs/rss": "^4.0.13",
"@astrojs/sitemap": "^3.6.0",
"@expressive-code/plugin-collapsible-sections": "^0.40.2",
"@expressive-code/plugin-line-numbers": "^0.41.3",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@radix-ui/react-hover-card": "^1.1.15",
"@hedystia/astro-bun": "^0.3.2",
"@tailwindcss/vite": "^4.1.17",
"@types/react": "^19.2.6",
"@types/react-dom": "^19.2.3",
"@vercel/og": "^0.8.5",
"astro": "^5.15.9",
"astro-expressive-code": "^0.40.2",
"astro-google-analytics": "^1.0.3",
"astro-og": "^0.3.0",
"astro-og-canvas": "^0.7.2",
"astro-robots-txt": "^1.0.0",
@ -47,7 +46,6 @@
"tailwindcss": "^4.1.17",
"tailwindcss-animate": "^1.0.7",
"tw-animate-css": "^1.4.0",
"twikoo": "^1.6.44",
"typescript": "^5.9.3"
},
"devDependencies": {

View file

@ -1,7 +1,6 @@
---
import { NoiseBackground } from "~/components/react/noise-background"
// import { NoiseBackground } from "~/components/react/noise-background"
import { getLangFromUrl } from "~/i18n/utils"
import { GoogleAnalytics } from "astro-google-analytics"
import { en, de } from "~/config"
import { ClientRouter } from "astro:transitions"
@ -16,8 +15,6 @@ const urls = {
general: `/images/general/ogImage.png`,
}
const isPost = post
const ogImageURL = new URL(post ? urls.postURL : urls.general, Astro.site).href
const permalink = new URL(Astro.url.pathname, Astro.site).href
const config = lang === "de" ? de : en

View file

@ -1,7 +1,7 @@
export const prerender = true
import { getCollection, type CollectionEntry } from "astro:content"
import { type CollectionEntry } from "astro:content"
import fs from "fs"
import { join, resolve } from "node:path"
import { join } from "node:path"
import { ImageResponse } from "@vercel/og"
import { getPostsByLocale } from "~/utils"
import type { ReactElement } from "react"

6960
yarn.lock

File diff suppressed because it is too large Load diff