26 lines
589 B
Docker
26 lines
589 B
Docker
|
|
# Stage 1: Build the Nuxt application
|
||
|
|
FROM node:20-alpine AS builder
|
||
|
|
WORKDIR /app
|
||
|
|
COPY /app/package*.json ./
|
||
|
|
RUN npm install
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
RUN npm run build
|
||
|
|
FROM node:20-alpine AS runner
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
COPY --from=builder /app/.output ./.output
|
||
|
|
COPY --from=builder /app/package*.json ./
|
||
|
|
COPY --from=builder /app/node_modules ./node_modules
|
||
|
|
|
||
|
|
# Ensure necessary environment variables are set if needed at runtime
|
||
|
|
# Nuxt uses NUXT_ prefix for runtime environment variables
|
||
|
|
EXPOSE 3030
|
||
|
|
|
||
|
|
ENV NUXT_PORT=3030
|
||
|
|
ENV PORT=3030
|
||
|
|
|
||
|
|
# Command to run the application
|
||
|
|
CMD ["node", "./.output/server/index.mjs"]
|