Skip to content

Instantly share code, notes, and snippets.

@kritsanapr
Created September 15, 2022 09:55
Show Gist options
  • Select an option

  • Save kritsanapr/5e263013a7a0461d04a6c7ff8201bbdd to your computer and use it in GitHub Desktop.

Select an option

Save kritsanapr/5e263013a7a0461d04a6c7ff8201bbdd to your computer and use it in GitHub Desktop.
Dockerfile : Nuxt Start (Universal SSR)
# Stage 1 - build
FROM node:8.15-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2 - production
FROM node:8.15-alpine AS final
WORKDIR /app
ADD package.json .
ADD nuxt.config.js .
COPY --from=builder /app/.nuxt ./.nuxt
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/static ./static
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
EXPOSE 3000
CMD ["npm", "start"]
@kritsanapr
Copy link
Author

Dockfile for Nuxt SSR node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment