https://github.com/alphaolomi/flask-mongo
Flask with MongoDB and Docker
https://github.com/alphaolomi/flask-mongo
docker docker-compose dockerized flask flask-application hacktoberfest mong mongo python3
Last synced: 12 months ago
JSON representation
Flask with MongoDB and Docker
- Host: GitHub
- URL: https://github.com/alphaolomi/flask-mongo
- Owner: alphaolomi
- License: bsd-3-clause
- Created: 2019-12-09T20:21:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-20T14:43:24.000Z (over 5 years ago)
- Last Synced: 2025-01-11T16:26:34.276Z (about 1 year ago)
- Topics: docker, docker-compose, dockerized, flask, flask-application, hacktoberfest, mong, mongo, python3
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask with Mongo and Docker
## Setup
```bash
docker-compose up -d
docker ps
```
```bash
docker exec -it mongodb bash
mongo -u mongodbuser -p
```
```
show dbs;
db.createUser({user: 'flaskuser', pwd: 'your password', roles: [{role: 'readWrite', db: 'flaskdb'}]})
exit
```
```
mongo -u flaskuser -p your password --authenticationDatabase flaskdb
exit
```
## Running the Flask To-do App
```bash
curl -i http://your_server_ip
curl -i\
-H "Content-Type: application/json" \
-X POST -d '{"todo": "Dockerize Flask application with MongoDB backend"}'\
http://your_server_ip/todo
# list all
curl -i http://your_server_ip/todo
```