move back to bun, hopefully fix docker and 404
This commit is contained in:
parent
74416bae2d
commit
155b2bc649
8 changed files with 1927 additions and 6980 deletions
54
Dockerfile
Normal file
54
Dockerfile
Normal 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" ]
|
||||||
|
|
@ -9,18 +9,16 @@ import { defineConfig } from "astro/config"
|
||||||
|
|
||||||
import robotsTxt from "astro-robots-txt"
|
import robotsTxt from "astro-robots-txt"
|
||||||
import addClasses from "rehype-class-names"
|
import addClasses from "rehype-class-names"
|
||||||
// import remarkRehype from "remark-rehype"
|
|
||||||
|
|
||||||
import og from "astro-og";
|
import og from "astro-og";
|
||||||
|
import bun from "@hedystia/astro-bun";
|
||||||
|
|
||||||
import node from "@astrojs/node";
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
adapter: bun(),
|
||||||
output: "server",
|
output: "server",
|
||||||
prefetch: true,
|
prefetch: true,
|
||||||
site: "https://lio.cat",
|
site: "https://lio.cat",
|
||||||
|
|
||||||
markdown: {
|
markdown: {
|
||||||
remarkRehype: {},
|
remarkRehype: {},
|
||||||
rehypePlugins: [
|
rehypePlugins: [
|
||||||
|
|
@ -45,8 +43,4 @@ export default defineConfig({
|
||||||
showLineNumbers: true,
|
showLineNumbers: true,
|
||||||
},
|
},
|
||||||
}), mdx({}), robotsTxt(), og()],
|
}), mdx({}), robotsTxt(), og()],
|
||||||
|
|
||||||
adapter: node({
|
|
||||||
mode: "standalone",
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal 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
|
||||||
|
|
||||||
|
|
@ -5,29 +5,28 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev --host 0.0.0.0",
|
"dev": "astro dev --host 0.0.0.0",
|
||||||
"build": "astro check && astro build",
|
"build": "astro check && astro build",
|
||||||
|
"check": "astro check",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"start": "HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs"
|
"start": "bun run ./dist/server/entry.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.5",
|
"@astrojs/check": "^0.9.5",
|
||||||
"@astrojs/mdx": "^4.3.11",
|
"@astrojs/mdx": "^4.3.11",
|
||||||
"@astrojs/node": "^9.5.1",
|
|
||||||
"@astrojs/react": "^4.4.2",
|
"@astrojs/react": "^4.4.2",
|
||||||
"@astrojs/rss": "^4.0.13",
|
"@astrojs/rss": "^4.0.13",
|
||||||
"@astrojs/sitemap": "^3.6.0",
|
"@astrojs/sitemap": "^3.6.0",
|
||||||
"@expressive-code/plugin-collapsible-sections": "^0.40.2",
|
"@expressive-code/plugin-collapsible-sections": "^0.40.2",
|
||||||
"@expressive-code/plugin-line-numbers": "^0.41.3",
|
"@expressive-code/plugin-line-numbers": "^0.41.3",
|
||||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
"@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",
|
"@tailwindcss/vite": "^4.1.17",
|
||||||
"@types/react": "^19.2.6",
|
"@types/react": "^19.2.6",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vercel/og": "^0.8.5",
|
"@vercel/og": "^0.8.5",
|
||||||
"astro": "^5.15.9",
|
"astro": "^5.15.9",
|
||||||
"astro-expressive-code": "^0.40.2",
|
"astro-expressive-code": "^0.40.2",
|
||||||
"astro-google-analytics": "^1.0.3",
|
|
||||||
"astro-og": "^0.3.0",
|
"astro-og": "^0.3.0",
|
||||||
"astro-og-canvas": "^0.7.2",
|
"astro-og-canvas": "^0.7.2",
|
||||||
"astro-robots-txt": "^1.0.0",
|
"astro-robots-txt": "^1.0.0",
|
||||||
|
|
@ -47,7 +46,6 @@
|
||||||
"tailwindcss": "^4.1.17",
|
"tailwindcss": "^4.1.17",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"twikoo": "^1.6.44",
|
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
import { NoiseBackground } from "~/components/react/noise-background"
|
// import { NoiseBackground } from "~/components/react/noise-background"
|
||||||
import { getLangFromUrl } from "~/i18n/utils"
|
import { getLangFromUrl } from "~/i18n/utils"
|
||||||
import { GoogleAnalytics } from "astro-google-analytics"
|
|
||||||
import { en, de } from "~/config"
|
import { en, de } from "~/config"
|
||||||
import { ClientRouter } from "astro:transitions"
|
import { ClientRouter } from "astro:transitions"
|
||||||
|
|
||||||
|
|
@ -16,8 +15,6 @@ const urls = {
|
||||||
general: `/images/general/ogImage.png`,
|
general: `/images/general/ogImage.png`,
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPost = post
|
|
||||||
|
|
||||||
const ogImageURL = new URL(post ? urls.postURL : urls.general, Astro.site).href
|
const ogImageURL = new URL(post ? urls.postURL : urls.general, Astro.site).href
|
||||||
const permalink = new URL(Astro.url.pathname, Astro.site).href
|
const permalink = new URL(Astro.url.pathname, Astro.site).href
|
||||||
const config = lang === "de" ? de : en
|
const config = lang === "de" ? de : en
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
export const prerender = true
|
export const prerender = true
|
||||||
import { getCollection, type CollectionEntry } from "astro:content"
|
import { type CollectionEntry } from "astro:content"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import { join, resolve } from "node:path"
|
import { join } from "node:path"
|
||||||
import { ImageResponse } from "@vercel/og"
|
import { ImageResponse } from "@vercel/og"
|
||||||
import { getPostsByLocale } from "~/utils"
|
import { getPostsByLocale } from "~/utils"
|
||||||
import type { ReactElement } from "react"
|
import type { ReactElement } from "react"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue