38 lines
664 B
Docker
38 lines
664 B
Docker
# ---------- Build Stage ----------
|
|
FROM node:24-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache python3 make g++ git
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
ARG CACHEBUST=1
|
|
COPY . .
|
|
|
|
RUN ls -la
|
|
|
|
# Generate content files
|
|
RUN node convert.js --vault ./vault --out ./content --img-prefix https://cdn.aranroig.com/campaigns/test
|
|
|
|
# Build the Nuxt app
|
|
RUN npm run build
|
|
|
|
# ---------- Production Stage ----------
|
|
FROM node:24-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built output
|
|
COPY --from=builder /app/.output ./.output
|
|
|
|
# Expose Nuxt port
|
|
EXPOSE 3000
|
|
|
|
# Start Nuxt production server
|
|
CMD ["node", ".output/server/index.mjs"]
|