mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Fix bugs with deploying images
- Exclude resvg native modules - Copy resvg native mods into final image - ensure deps are correct for alpine
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# build the sapper app
|
# build the sapper app
|
||||||
FROM node AS base
|
FROM node:alpine AS base
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
@@ -12,11 +12,13 @@ WORKDIR /app
|
|||||||
FROM base AS build
|
FROM base AS build
|
||||||
ENV CI=1
|
ENV CI=1
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
RUN mkdir ../node_modules
|
||||||
|
RUN cp -Lr node_modules/.pnpm/@resvg+resvg-*@*/node_modules/* ../node_modules/
|
||||||
# RUN cd packages/website; --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
# RUN cd packages/website; --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
|
||||||
RUN cd packages/website; pnpm run build
|
RUN cd packages/website; pnpm run build
|
||||||
|
|
||||||
run cd packages/website; pnpm exec rollup -c server-rollup.config.mjs
|
RUN cd packages/website; pnpm exec rollup -c server-rollup.config.mjs
|
||||||
# copy node_modules/ and other build files over
|
# copy node_modules/ and other build files over
|
||||||
FROM node:alpine
|
FROM node:alpine
|
||||||
|
|
||||||
@@ -26,6 +28,7 @@ COPY --from=build /app/packages/website/output .
|
|||||||
COPY --from=build /app/packages/website/build/client ./client/
|
COPY --from=build /app/packages/website/build/client ./client/
|
||||||
COPY --from=build /app/packages/website/build/prerendered ./prerendered/
|
COPY --from=build /app/packages/website/build/prerendered ./prerendered/
|
||||||
COPY --from=build /app/packages/website/package.json ./package.json
|
COPY --from=build /app/packages/website/package.json ./package.json
|
||||||
|
COPY --from=build /node_modules ./node_modules/
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"@fontsource/fira-mono": "^5.0.13",
|
"@fontsource/fira-mono": "^5.0.13",
|
||||||
"@json-feed-types/1_1": "^1.0.2",
|
"@json-feed-types/1_1": "^1.0.2",
|
||||||
"@rollup/plugin-commonjs": "^25.0.8",
|
"@rollup/plugin-commonjs": "^25.0.8",
|
||||||
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@rollup/pluginutils": "^5.1.0",
|
"@rollup/pluginutils": "^5.1.0",
|
||||||
"@sveltejs/adapter-auto": "^3.2.2",
|
"@sveltejs/adapter-auto": "^3.2.2",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// rollup.config.mjs
|
// rollup.config.mjs
|
||||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import json from "@rollup/plugin-json";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'build/index.js',
|
input: 'build/index.js',
|
||||||
@@ -8,5 +9,7 @@ export default {
|
|||||||
dir: "output",
|
dir: "output",
|
||||||
format: 'esm'
|
format: 'esm'
|
||||||
},
|
},
|
||||||
plugins: [nodeResolve(), commonjs()]
|
// external: id => id.startsWith("@resvg/resvg-js-"),
|
||||||
|
external: ["@resvg/resvg-js"],
|
||||||
|
plugins: [nodeResolve(), json(), commonjs()]
|
||||||
};
|
};
|
||||||
@@ -99,7 +99,7 @@ export async function GET({ url }) {
|
|||||||
color: '#202020',
|
color: '#202020',
|
||||||
margin: '10px 0 10px'
|
margin: '10px 0 10px'
|
||||||
},
|
},
|
||||||
children: `Published on ${new Date(page.date).toLocaleDateString()} \xB7 By Jade Ellis \xB7 ${page.readingTime.text}`
|
children: `Published on ${new Date(page.date).toLocaleDateString()} · By Jade Ellis · ${page.readingTime.text}`
|
||||||
})]
|
})]
|
||||||
});
|
});
|
||||||
const svg = await satori(template, {
|
const svg = await satori(template, {
|
||||||
|
|||||||
Generated
+3
@@ -126,6 +126,9 @@ importers:
|
|||||||
'@rollup/plugin-commonjs':
|
'@rollup/plugin-commonjs':
|
||||||
specifier: ^25.0.8
|
specifier: ^25.0.8
|
||||||
version: 25.0.8(rollup@4.18.0)
|
version: 25.0.8(rollup@4.18.0)
|
||||||
|
'@rollup/plugin-json':
|
||||||
|
specifier: ^6.1.0
|
||||||
|
version: 6.1.0(rollup@4.18.0)
|
||||||
'@rollup/plugin-node-resolve':
|
'@rollup/plugin-node-resolve':
|
||||||
specifier: ^15.2.3
|
specifier: ^15.2.3
|
||||||
version: 15.2.3(rollup@4.18.0)
|
version: 15.2.3(rollup@4.18.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user