Giter Club home page Giter Club logo

angular-cli-docker-ootb's Introduction

Angular CLI with Docker

This is an example app created with the Angular CLI that runs with Docker

I ran ng new myapp to generate the app. Then added the 4 docker files:

.dockerignore
docker-compose.yml
docker-compose.debug.yml
Dockerfile

Running

Two options are available. I prefer the docker compose technique

Option 1) You can run docker build and docker run

docker build --rm -f Dockerfile -t angular-cli-docker-ootb:latest .
docker run --rm -d -p 443:443 -p 80:80 angular-cli-docker-ootb:latest

Option 2) You can run docker compose docker-compose up -d --build

Faster

This example uses the node alpine image and then installs the latest Angular CLI. If you want to use an image that has node alpine and the Angular CLI already isntalled, you can change your Dockerfile to use johnpapa/angular-cli. SOmething like this ...

FROM johnpapa/angular-cli as angular-built
WORKDIR /usr/src/app
COPY package.json package.json
RUN npm install --silent
COPY . .
RUN ng build --prod --build-optimizer

FROM nginx:alpine
LABEL author="John Papa"
COPY --from=angular-built /usr/src/app/dist /usr/share/nginx/html
EXPOSE 80 443
CMD [ "nginx", "-g", "daemon off;" ]

The catch on this is that it uses an unofficial docker image that I created. I try to keep it updated, but the latest will always be to install it yourself in the Dockerfile

angular-cli-docker-ootb's People

Contributors

angular-cli avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.