Skip to content

Instantly share code, notes, and snippets.

@teitei-tk

teitei-tk/Dockerfile

Last active Oct 26, 2020
Embed
What would you like to do?
Next.js Multi Stage Build Dockerfile
FROM node:14-alpine as base
WORKDIR /app/js/base
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
RUN yarn install
COPY . .
FROM node:14-alpine as builder
ENV NODE_ENV=production
WORKDIR /app/js/builder
COPY --from=base /app/js/base /app/js/builder
RUN ["yarn", "build"]
FROM nginx:latest as production
WORKDIR /app/js/src
RUN rm -rf /etc/nginx/conf.d
ADD conf/nginx/conf.d /etc/nginx/conf.d
COPY --from=builder /app/js/builder/out ./out
EXPOSE 80
{
"name": "go-next.js-playground",
"version": "1.0.0",
"main": "index.js",
"repository": "ssh://git@github.com/teitei-tk/go-next.js-playground.git",
"author": "teitei-tk <teitei.tk@gmail.com>",
"license": "MIT",
"private": true,
"scripts": {
"dev": "next",
"build": "next build && next export",
"start": "next start"
},
"dependencies": {
"next": "^9.4.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^1.1.1"
},
"devDependencies": {
"@types/node": "^14.0.23",
"@types/react": "^16.9.43",
"file-loader": "^6.0.0",
"typescript": "^3.9.7",
"url-loader": "^4.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.