Skip to content

Commit

Permalink
add mongo, db folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Risch committed Sep 4, 2018
1 parent e3ff8e0 commit 302caf0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
Binary file added data/db/local.0
Binary file not shown.
Binary file added data/db/local.ns
Binary file not shown.
Empty file added data/db/mongod.lock
Empty file.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ services:
- "2222:22"
volumes:
- ~/.ssh/id_rsa.pub:/home/ubuntu/.ssh/authorized_keys
- ./nginx/web:/var/www/html
- ./nginx/web:/var/www/html
- ./data/db:/data/db
4 changes: 3 additions & 1 deletion nginx/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

@app.route("/")
def hello():
return "Hello World!"
mongo = subprocess.Popen(['service','mongodb','status'], stdout=subprocess.PIPE)
stdout = mongo.communicate()[0]
return 'Mongo Status %s' % stdout

if __name__ == "__main__":
app.run(host='0.0.0.0')
Binary file modified nginx/web/app.pyc
Binary file not shown.
16 changes: 10 additions & 6 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Install Packages
- name: Install the packages
apt:
name: ["python-pip", "python-dev", "nginx", "gunicorn"]
name: ["python-pip", "python-dev", "nginx", "gunicorn", "locales", "mongodb"]
state: present
# Nginx Configuration
- name: Copy NGINX
Expand All @@ -21,15 +21,19 @@
pip:
name: flask
state: present
#Start Gunicorn
- name: Spinup Gunicorn
command: gunicorn --daemon --bind 0.0.0.0:5000 wsgi:app
args:
chdir: '/var/www/html'
- name: Install MongoDb
apt:
name: mongodb
state: present
#Locale Fixes for Mongodb
- name: Set Locale
command: locale-gen en_US.UTF-8
- name: Update Locale
command: update-locale
#Start Mongodb Service
- name: Ensure Mongodb Service Up
service:
name: mongodb
state: started
enabled: yes
state: running

0 comments on commit 302caf0

Please sign in to comment.