fixed dockerfile... and other stuff...
This commit is contained in:
38
Dockerfile
38
Dockerfile
@@ -1,26 +1,28 @@
|
||||
# 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
|
||||
FROM node:lts-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/.output ./.output
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY site/package*.json ./site/
|
||||
|
||||
# Ensure necessary environment variables are set if needed at runtime
|
||||
# Nuxt uses NUXT_ prefix for runtime environment variables
|
||||
EXPOSE 3030
|
||||
RUN cd site && npm install
|
||||
COPY site ./site
|
||||
RUN cd site && npm run build
|
||||
|
||||
ENV NUXT_PORT=3030
|
||||
FROM node:lts-alpine
|
||||
WORKDIR /app
|
||||
|
||||
#COPY --from=builder /app/package*.json ./
|
||||
#COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/site/.output ./site/.output
|
||||
COPY --from=builder /app/site/package*.json ./site/
|
||||
|
||||
RUN cd site && npm ci --omit=dev
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3030
|
||||
|
||||
# Command to run the application
|
||||
CMD ["node", "./.output/server/index.mjs"]
|
||||
EXPOSE 3030
|
||||
|
||||
CMD ["node", "site/.output/server/index.mjs"]
|
||||
Reference in New Issue
Block a user