Created
October 28, 2016 03:13
-
-
Save viktor-evdokimov/5e20692efa15feb84236e30d77d1f828 to your computer and use it in GitHub Desktop.
next.js docker deployment
This file contains 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
FROM node:6-onbuild | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY package.json /usr/src/app/ | |
RUN npm install | |
COPY . /usr/src/app | |
#next specific build | |
RUN npm run build |
This file contains 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
{ | |
"name": "next-test", | |
"dependencies": { | |
"next": "latest" | |
}, | |
"scripts": { | |
"dev": "next", | |
"build": "next build", | |
"start": "next start -p 5000" | |
} | |
} |
This file contains 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
import React from 'react' | |
import Head from 'next/head' | |
export default () => ( | |
<div> | |
<Head> | |
<title>This page has a title 🤔</title> | |
<meta charSet='utf-8' /> | |
<meta name='viewport' content='initial-scale=1.0, width=device-width' /> | |
</Head> | |
<h1>This page has a title 🤔</h1> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not working for me:
> Couldn't find a `pages` directory. Please create one under the project root