Skip to content

Commit

Permalink
Fixed docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Viet Quoc Ta authored and PatrickJS committed Jul 20, 2018
1 parent b4eb96b commit 52b6cfd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Dockerfile-dev
@@ -0,0 +1,21 @@
# Usage:
#
# Build image:
# docker build -t angular-starter .
#
# Run image (on localhost:8080):
# docker run --name angular-starter -p 8080:80 angular-starter
#
# Run image as virtual host (read more: https://github.com/jwilder/nginx-proxy):
# docker run -e VIRTUAL_HOST=angular-starter.your-domain.com --name angular-starter angular-starter

FROM node:8.9.4-alpine as builder

COPY package.json ./

## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /ng-app && mv ./node_modules ./ng-app

WORKDIR /ng-app

COPY . .
7 changes: 5 additions & 2 deletions docker-compose.yml
Expand Up @@ -3,12 +3,15 @@ services:
angular-starter:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile-dev
container_name: angular-starter
networks:
- angular-starter
ports:
- '8080:80'
- '3000:3000'
environment:
- HOST=0.0.0.0
command: npm run start
networks:
angular-starter:
driver: bridge

0 comments on commit 52b6cfd

Please sign in to comment.