reworked astro collections

This commit is contained in:
2025-06-22 05:28:44 +02:00
parent 459873f0e5
commit 9628eea874
16 changed files with 381 additions and 169 deletions

View File

@@ -1,19 +1,26 @@
FROM node:18-alpine
FROM node:lts AS base
WORKDIR /app
# Set working directory
WORKDIR /opt/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.
# Therefore, the `-deps` steps will be skipped if only the source code changes.
COPY package.json package-lock.json ./
# Copy package files
COPY package*.json ./
FROM base AS prod-deps
RUN npm install --omit=dev
# Install dependencies
RUN npm ci
FROM base AS build-deps
RUN npm install
# Copy source code
FROM build-deps AS build
COPY . .
RUN npm run build
FROM base AS runtime
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
ENV HOST=0.0.0.0
ENV PORT=4321
# Expose port
EXPOSE 4321
# Start the development server
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
CMD node ./dist/server/entry.mjs