return back to npm

This commit is contained in:
Lio 2024-07-20 10:15:50 +02:00
parent a86fbff587
commit fbbc2129f7
9 changed files with 26 additions and 30 deletions

View file

@ -1,39 +1,23 @@
FROM node:lts AS base FROM node:lts-slim as runtime
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app WORKDIR /app
# By copying only the package.json and package-lock.json here, we ensure that the following `-deps` steps are independent of the source code. # Ensure that both node_modules and package-lock.json are removed.
# Therefore, the `-deps` steps will be skipped if only the source code changes. COPY package.json .
COPY package.json pnpm-lock.yaml ./ RUN rm -rf node_modules package-lock.json
# Perform a fresh installation of npm dependencies.
RUN npm install
WORKDIR /app # Copy the rest of your application files.
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod
FROM base AS build-deps
RUN pnpm install
FROM build-deps AS build
COPY . . COPY . .
RUN pnpm run build
FROM base AS runtime # Build your application.
COPY --from=prod-deps /app/node_modules ./node_modules RUN npm run build
COPY --from=build /app/dist ./dist
# Set environment variables and expose the appropriate port.
ENV HOST=0.0.0.0 ENV HOST=0.0.0.0
ENV PORT=4321 ENV PORT=4321
EXPOSE 4321 EXPOSE 4321
# Define the command to run your application.
CMD node ./dist/server/entry.mjs CMD node ./dist/server/entry.mjs

View file

@ -7,7 +7,7 @@ import react from "@astrojs/react";
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [tailwind(), react()], integrations: [tailwind(), react()],
output: "hybrid", output: "server",
adapter: node({ adapter: node({
mode: "standalone", mode: "standalone",
}), }),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 MiB

After

Width:  |  Height:  |  Size: 12 MiB

View file

@ -102,7 +102,7 @@
} }
.desc { .desc {
background-color: white; background-color: darkgrey;
max-width: 20%; max-width: 20%;
margin: auto auto; margin: auto auto;
padding: 1rem; padding: 1rem;

View file

@ -35,5 +35,6 @@ const { title, background } = config;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-attachment: fixed; background-attachment: fixed;
color: whitesmoke;
} }
</style> </style>

View file

@ -45,6 +45,7 @@ const { title, background } = config;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-attachment: fixed; background-attachment: fixed;
color: whitesmoke;
} }
/* /*
:root { :root {

View file

@ -29,5 +29,11 @@ import config from "../../config.yaml";
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-attachment: fixed; background-attachment: fixed;
color: whitesmoke;
/* backdrop-filter: brightness(0.5); */
/* width: 100%;
height: 100%;
margin: 0;
padding: 0; */
} }
</style> </style>

View file

@ -38,6 +38,8 @@ const images = imageCollection.map((record) => {
nsfw: record.nsfw, nsfw: record.nsfw,
}; };
}); });
export const prerender = true
--- ---
<Gallery> <Gallery>

View file

@ -7,6 +7,8 @@ const characters = await pb
.collection("characters") .collection("characters")
// @ts-ignore // @ts-ignore
.getFullList({ expand: ["icon"] }); .getFullList({ expand: ["icon"] });
export const prerender = true
--- ---
<CharacterList> <CharacterList>