Code Monkey home page Code Monkey logo

docker-mean-ts-starter's Introduction

Starter project for a dockerized MEAN webapp (+Typescript)

This repository provides an out-of-the-box environment for a fully dockerized web application.

Application Stack

image

  • Docker, docker-compose container platform, orchestration
  • Typescript code frontend, backend
  • MongoDB document database
  • Express web server
  • AngularJS frontend js/ts framework
  • Node.js backend
  • Pug template engine, used for Angular component templates

Call for PRs regarding Angular upgrade

With this established environment, I could not get Angular (4) running, so I use AngularJS for now. Any ideas would be appreciated - just create a PR.

Features

zero downtime development with Docker, hot code reload, browser auto-refresh, debugging

Prerequisites

Docker and Docker Compose are necessary.

Build & Run

First, install dependencies locally.

npm install

Now, we use docker-compose for orchestration of the 3 docker containers used:

  • web is the node.js web server (based on the slim mhart/alpine-node)
  • mongo is the mongoDB database (based on mongo)
  • mongo-import feeds the db in mongo with some dummy data (see sub-directory mongo-import, also based on mongo)

Environments

To separate development features from the actual application, three docker-compose configs are used.

  • base.yml is the base config

  • dev.yml should only be used for development environment, since it mounts the project directory, starts file watchers, enables auto-restarts and exposes debugging ports

  • prod.yml production-safe config

Run Production

docker-compose -f compose-base.yml -f compose-prod.yml up

Run Dev

docker-compose -f compose-base.yml -f compose-dev.yml up --build

-build rebuilds the image if changes are detected

optional: -d makes the container running in the background (use docker stop to stop)

Display the app in your browser

http://localhost:8080

Debug the dockerized node.js application

The repository contains a debug configuration which you can use with WebStorm for example. See more details about remote node.js debugging here

docker-mean-ts-starter's People

Contributors

alex-gru avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dfpcloud jonato1

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.