Created
September 15, 2022 09:55
-
-
Save kritsanapr/5e263013a7a0461d04a6c7ff8201bbdd to your computer and use it in GitHub Desktop.
Dockerfile : Nuxt Start (Universal SSR)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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"] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dockfile for Nuxt SSR node