Coder Social home page Coder Social logo

mean-docker's Introduction

MEAN DOCKER

This repo contains a simple project that uses the MEAN stack (Mongo, Express, Angular, Node JS) to build a single page app (SPA) that could be easily configured and deployed with Docker and Docker compose.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

First, be sure that you have the following dependencies installed:

Docker - Available for Linux, Mac o Windows
Docker compose - Available for Linux, Mac o Windows

Then, clone the repo from GitHub:

git clone https://github.com/javadababadoo/mean-docker.git
cd mean-docker

Directory structure

  • backend/device-core - App backend source built with Node JS, Express and Mongoose.
  • deployment/compose - Directory where its located the docker compose YAML file.
  • frontend - App frontend source.
  • scripts - Scripts used to populate the database.
  • seed - Docker file that defines the instructions to seed the app.

File structure

  • backend/device-core/Dockerfile - Defines the dockerfile for device core (Backend - Node JS Server).
  • frontend/DeviceManagement/Dockerfile - Defines the dockerfile for device management (Frontend - Angular).
  • seed/Dockerfile - Defines the dockerfile to seed the Mongo database.
  • deployment/compose/docker-compose.seed.yml - Defines the docker compose file to configure the application's services. (Here the Mongo database is populated).
  • deployment/compose/docker-compose.yml - Defines the docker compose file to configure the application's services.
  • scripts/devices.json - the archive contains the devices data that will be import into mongo.

Deployment

this project is using Docker and Docker compose as tools that helps us to easily configure and deploy the full app.

Go to frontend/DeviceManagement/ located in the project directory:

cd frontend/DeviceManagement/

Execute the next commands:

npm install 
ng build --prod

In order to deploy the app, we have to take into account the following archives:

  • deployment/compose/docker-compose-seed.yml - Populates the Mongo database only necessary the first time the app is deployed.

  • deployment/compose/docker-compose.yml - Deploys the full app.

first thing that you need to do, if you haven't deployed the app is execute the next command in the terminal to seed the Mongo database:

docker-compose -f docker-compose.yml -f docker-compose.seed.yml up -d

Otherwise, just execute the next command:

docker-compose up

localhost:80

Built With

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

mean-docker's People

Contributors

jestebanzapata avatar jaimezapata avatar juansantane avatar

Watchers

James Cloos 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.