Thursday, 20 April 2017

How do I expose ports in Docker on Windows 10?

I have a properly installed copy of Docker CE on my Windows 10 Pro machine.

I am trying to run a simple node app using docker-compose and be able to dynamically update the code while running in docker. I followed this website to build it out, and my code can be found here.

My Dockerfile:

FROM node:6.10.2

RUN useradd --user-group --create-home --shell /bin/false app

ENV HOME=/home/app

COPY package.json npm-shrinkwrap.json $HOME/diet-program/
RUN chown -R app:app $HOME/*

USER app
WORKDIR $HOME/diet-program
RUN npm install

EXPOSE 8080

CMD ["npm", "run", "dev"]

My docker-compose.yml:

version: '2'

services:
  diet-program:
    build: .
    ports:
      - 8080:8080
    volumes:
      - .:/home/app/diet-program
      - /home/app/diet-program/node_modules

The dev command is mapped to: webpack-dev-server --content-base src --inline --hot



via Blaze Phoenix

No comments:

Post a Comment