All Projects → gimdongwoo → docker-parse-mongo

gimdongwoo / docker-parse-mongo

Licence: MIT License
Parse Server with MongoDB ReplicaSet using Docker (for AWS EC2 or GCP GCE)

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to docker-parse-mongo

AmbulanceLocator
Ambulance Locator lets the user find nearby ambulances and as well as call the nearby ambulances.
Stars: ✭ 15 (-44.44%)
Mutual labels:  parse-server, aws-ec2
Codo Cmdb
基于Tornado实现的一套资产管理系统、支持AWS、阿里云、腾讯云、华为云自动拉取资产信息等
Stars: ✭ 205 (+659.26%)
Mutual labels:  docker-compose, aws-ec2
kubernetes-ami
A simple AMI and CloudFormation for launching Kubernetes on AWS
Stars: ✭ 41 (+51.85%)
Mutual labels:  aws-ec2
docker4ruby
Docker-based Ruby stack (works for Rails)
Stars: ✭ 27 (+0%)
Mutual labels:  docker-compose
goship
Utility that helps find, connect and copy to particular cloud resources using configured providers
Stars: ✭ 18 (-33.33%)
Mutual labels:  aws-ec2
parse-stack
Parse Server Ruby Client SDK
Stars: ✭ 59 (+118.52%)
Mutual labels:  parse-server
EHR-on-blockchain
A Electronic Health Records system on hyperledger fabric maintained by consortium of hospitals for patients.
Stars: ✭ 35 (+29.63%)
Mutual labels:  aws-ec2
polynimbus
Multi-cloud infrastructure inventory and management tool, supporting AWS, Google Cloud, Azure, Oracle Cloud, Rackspace Cloud, Hetzner Cloud, Alibaba Cloud, e24cloud.com, Linode, Cloudflare, GoDaddy and Backblaze B2.
Stars: ✭ 70 (+159.26%)
Mutual labels:  aws-ec2
docker-compose-v3
No description or website provided.
Stars: ✭ 15 (-44.44%)
Mutual labels:  docker-compose
CloudRemoting
CloudRemoting PowerShell module - an easier way to PSRemoting, RDP and SSM Run Commands.
Stars: ✭ 18 (-33.33%)
Mutual labels:  aws-ec2
cloud-cheat-sheets
My handmade cheat-sheets for different AWS services.
Stars: ✭ 63 (+133.33%)
Mutual labels:  aws-ec2
parse-cloud-class
Extendable way to set up Parse Cloud classes behaviour
Stars: ✭ 40 (+48.15%)
Mutual labels:  parse-server
parse-server-gcs-adapter
parse-server adapter for Google Cloud Storage
Stars: ✭ 26 (-3.7%)
Mutual labels:  parse-server
CareKitSample-ParseCareKit
An example application of CareKit's OCKSample synchronizing iOS and watchOS to the cloud via ParseCareKit and parse-hipaa
Stars: ✭ 18 (-33.33%)
Mutual labels:  parse-server
snowflake
A React-Native Android iOS Starter App/ BoilerPlate / Example with Redux, RN Router, & Jest with the Snowflake Hapi Server running locally or on RedHat OpenShift for the backend, or a Parse Server running locally or remotely on Heroku
Stars: ✭ 13 (-51.85%)
Mutual labels:  parse-server
cv4pve-metrics
Metrics for Proxmox VE, Grafana with dasboard, InfluxDb
Stars: ✭ 38 (+40.74%)
Mutual labels:  docker-compose
mern-app
Basic MERN app template for AWS EC2 Deployment guide
Stars: ✭ 30 (+11.11%)
Mutual labels:  aws-ec2
benchmark
Parse Server Continuous Benchmark
Stars: ✭ 21 (-22.22%)
Mutual labels:  parse-server
parse-server-simple-mailgun-adapter
Used to send Parse Server password reset and email verification emails though Mailgun
Stars: ✭ 81 (+200%)
Mutual labels:  parse-server
aws-terraform
AWS & Terraform Rocket Start Guide
Stars: ✭ 53 (+96.3%)
Mutual labels:  aws-ec2

Parse Server with MongoDB ReplicaSet using Docker

This branch is for AWS EC2

If you want to use Google Cloud Platform, try GCP branch

Notes

It's probably not a good idea to run this setup in production as each mongo instance should be split across different machines. However for a single ec2 instance environment this fits our needs.

Usage

  • Start and show logs (turn off logs : ctrl+c)

     $ docker-compose up -d && docker-compose logs -f
     (or)
     $ ./prod_start.sh
  • Stop

     $ docker-compose down
     (or)
     $ ./prod_stop.sh
  • Restart parseapi container

     $ docker-compose restart parseapi
     (or)
     $ ./prod_restart.sh

Setup

Init MongoDB

  1. Initial replicaset

    $ docker-compose -f docker-compose-init.yml up
    (Stop after all work is done : ctrl + c)
  2. Copy, remove '_sample' from the name, and change password these files

    • /scripts/config_sample.sh > /scripts/config.sh
    • /parse-server/config_sample.sh > /parse-server/config.sh
    • /parse-server/config_dev_sample.sh > /parse-server/config_dev.sh
  3. Add authentication

    $ docker-compose -f docker-compose-addauth.yml up
    (Stop after all work is done : ctrl + c)

    If added user failed, retry until shown 'Successfully added user'.

Change Parse-server Keys

  • You need to change Parse-server keys in these files.

    • /parse-server/config.sh
    • /parse-server/config_dev.sh
  • For making new keys, I recommend to use randomkeygem.com

Parse-server

  • Default address

     $ curl http://localhost/parse
  • Dashboard (Web Data Browser)

     http://localhost/dashboard

Parse Server external path

  • 'parse-server/cloud' and 'parse-server/public' are accessable volume.
    • you can modify them and restart parseapi container for deploy.

Development

  • The MongoDB can be remotely located instance and you can run the local parse-server to facilitate cloud-code development.

     docker-compose -f docker-compose-dev.yml up -d && docker-compose logs -f
     (or)
     $ ./dev_start.sh

Access Bash shell of Container

  • Check Status of Docker containers

     $ docker ps
     CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                                                NAMES
     b1ea1556bbf6        node:6              "/parse/setup.sh"        About a minute ago   Up About a minute   0.0.0.0:1337->1337/tcp                               dockerparsemongo_parseapi_1
     12cfb5cdbfd8        mongo:3.4           "mongod --replSet ..."   About a minute ago   Up About a minute   0.0.0.0:27017->27017/tcp, 0.0.0.0:28017->28017/tcp   dockerparsemongo_mongo1_1
     1c2627bb53a7        mongo:3.4           "mongod --replSet ..."   About a minute ago   Up About a minute   0.0.0.0:27019->27017/tcp, 0.0.0.0:28019->28017/tcp   dockerparsemongo_mongo2_1
     eb3996cdf662        mongo:3.4           "mongod --replSet ..."   About a minute ago   Up About a minute   0.0.0.0:27018->27017/tcp, 0.0.0.0:28018->28017/tcp   dockerparsemongo_mongo3_1
     $ docker-compose ps
                 Name                           Command               State                          Ports                        
     ----------------------------------------------------------------------------------------------------------------------------
     dockerparsemongo_mongo1_1       mongod --replSet rs0 --jou ...   Up       0.0.0.0:27017->27017/tcp, 0.0.0.0:28017->28017/tcp
     dockerparsemongo_mongo2_1       mongod --replSet rs0 --jou ...   Up       0.0.0.0:27019->27017/tcp, 0.0.0.0:28019->28017/tcp
     dockerparsemongo_mongo3_1       mongod --replSet rs0 --noj ...   Up       0.0.0.0:27018->27017/tcp, 0.0.0.0:28018->28017/tcp
     dockerparsemongo_mongosetup_1   /scripts/setup.sh                Exit 0                                                      
     dockerparsemongo_parseapi_1     /parse/setup.sh                  Up       0.0.0.0:1337->1337/tcp
  • Access shell of Parse-server container with

    • docker exec -it dockerparsemongo_parseapi_1 bash
    • docker-compose exec parseapi bash
  • Access shell of MongoDB container with

    • docker exec -it dockerparsemongo_mongo1_1 bash

    • docker-compose exec mongo1 bash

    • And, access mongo shell using mongo

Host O/S Guide

Choose your favorite Linux, such as AML or Ubuntu. Docker and Docker-Compose are required.

Add swap

  • t1-micro has 1Gb memory, requires swap

     $ sudo fallocate -l 2G /swapfile
     $ sudo chown root:root /swapfile
     $ sudo chmod 600 /swapfile
     $ sudo mkswap /swapfile	
     $ sudo swapon /swapfile
     $ sudo swapon -a
     $ sudo vi /etc/fstab
     
     (Add it to the last line.)
     /swapfile   swap   swap   defaults  0  0
     
     $ sudo swapon -s
     $ free -m

MongoDB Storage for EC2

  • When created EC2 instance, add 3 ebs volumes for db path.

  • mount ebs volumes to './data/rs0-1', './data/rs0-2', './data/rs0-3'

  • The free tier provides 30 GB of storage, I recommend this capacity configuration.

    • host : 9 GB / rs0-1 : 10 GB / rs0-2 : 10 GB / rs0-3 : 1 GB
     $ sudo mkfs.ext4 /dev/xvdb
     $ sudo mkfs.ext4 /dev/xvdc
     $ sudo mkfs.ext4 /dev/xvdd
     $ echo '/dev/xvdb __your-path__/data/rs0-1 ext4 defaults,auto,noatime,noexec 0 0
     /dev/xvdc __your-path__/data/rs0-2 ext4 defaults,auto,noatime,noexec 0 0
     /dev/xvdd __your-path__/data/rs0-3 ext4 defaults,auto,noatime,noexec 0 0' | sudo tee -a /etc/fstab

MongoDB Guide

MongoDB Backup & Restore

Management MongoDB

  • I reccommend to use adminMongo
    • Thank you @mrvautin

Inspired & Referenced by

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].