Skip to content
This repository was archived by the owner on Sep 22, 2019. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This repository is no longer maintained. See node-docker-devtools instead.

node-docker

How to use this image

Create a Dockerfile

Using ONBUILD

FROM jameskyburz/node:10.16.1-alpine
EXPOSE 5000

Using devtools (faster because of less cache invalidation)

FROM jameskyburz/node:10.16.1-alpine-devtools as devtools

WORKDIR /usr/src/app

COPY package.json package-lock*.json npm-shrinkwrap*.json /usr/src/app/
RUN npm i

FROM node:10.16.1-alpine

WORKDIR /usr/src/app

COPY . /usr/src/app
COPY --from=devtools /usr/src/app/node_modules /usr/src/app/node_modules

USER node

ENTRYPOINT ["node", "src/index"]
CMD []

Tell npm how to run your project in package.json

"scripts": {
  "start": "node index"
}

Create a docker-compose.yml file

version: '3'
services:
  web:
    build:
      context: ./src/yourapp
    restart: always

Build

ᐅ docker-compose build

Run the container

ᐅ docker-compose up

Debugging with docker-compose

Checkout debug.sh

Releases

Packages

Contributors

Languages