Skip to Main Content
Next.js Quick Start Guide
book

Next.js Quick Start Guide

by Kirill Konshin
July 2018
Intermediate to advanced content levelIntermediate to advanced
164 pages
3h 15m
English
Packt Publishing
Content preview from Next.js Quick Start Guide

Creating a Docker container for Next.js

Let's reiterate: Docker is a virtual machine with an OS that is capable of managing containers. So, how to bring the container image to a required tools, libs and settings? Via an instruction file, of course, because this process has to be reproducible on a dev machine, in staging, in production, and anywhere else.

A Dockerfile is a set of instructions that take a source image and bring it to a desired state, which results in an image too. Any existing Dockerfile's outcome image could in turn be taken as a source for another one, and so on.

Let's start with a super-minimal set of packages:

$ npm i react react-dom isomorphic-unfetch --save$ npm i next --save-dev

Next, we create scripts in package.json ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Create React App 2 Quick Start Guide

Create React App 2 Quick Start Guide

Brandon Richey
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781788993661Supplemental Content