Skip to content

Instantly share code, notes, and snippets.

@viktor-evdokimov
Created October 28, 2016 03:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viktor-evdokimov/5e20692efa15feb84236e30d77d1f828 to your computer and use it in GitHub Desktop.
Save viktor-evdokimov/5e20692efa15feb84236e30d77d1f828 to your computer and use it in GitHub Desktop.
next.js docker deployment
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
{
"name": "next-test",
"dependencies": {
"next": "latest"
},
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start -p 5000"
}
}
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>
)
@tokra
Copy link

tokra commented Jul 22, 2017

not working for me:
> Couldn't find a `pages` directory. Please create one under the project root

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