Integrate dockerized Mongodb configuration

This commit is contained in:
2020-04-15 00:43:40 +02:00
parent ff3a1a3523
commit 8687408d9c
5 changed files with 110 additions and 1 deletions

View File

@ -9,6 +9,7 @@
"type": "python",
"request": "launch",
"module": "flask",
"preLaunchTask": "Launch MongoDB",
"env": {
"FLASK_APP": "app/main.py",
"FLASK_ENV": "development",
@ -19,7 +20,28 @@
"--no-debugger",
"--no-reload"
],
"jinja": true
"jinja": true,
"postDebugTask": "Stop MongoDB"
},
{
"name": "Python: Flask (open to world)",
"type": "python",
"request": "launch",
"module": "flask",
"preLaunchTask": "Launch MongoDB",
"env": {
"FLASK_APP": "app/main.py",
"FLASK_ENV": "development",
"FLASK_DEBUG": "0"
},
"args": [
"run",
"--no-debugger",
"--no-reload",
"--host=0.0.0.0"
],
"jinja": true,
"postDebugTask": "Stop MongoDB"
}
]
}

50
backend/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,50 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Launch MongoDB",
"type": "shell",
"command": "docker-compose -f ${workspaceFolder}/docker/docker-compose.dev.yml up",
"isBackground": true,
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "."
}
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"group": "build"
},
{
"label": "Stop MongoDB",
"type": "shell",
"command": "docker-compose -f ${workspaceFolder}/docker/docker-compose.dev.yml stop"
},
{
"label": "Reset MongoDB",
"type": "shell",
"command": "docker-compose -f ${workspaceFolder}/docker/docker-compose.dev.yml rm -sf",
"problemMatcher": []
}
]
}

11
backend/docker/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM tiangolo/uwsgi-nginx-flask:python3.7
RUN pip install requests
RUN pip install pandas
RUN pip install Flask-BasicAuth
RUN pip install bs4
COPY ../app /app

View File

@ -0,0 +1,14 @@
version: '2'
services:
mongo:
extends:
file: docker-compose.yml
service: mongo
mongo-express:
depends_on:
- mongo
image: mongo-express
restart: always
ports:
- "8081:8081"

View File

@ -0,0 +1,12 @@
version: '2'
services:
mongo:
image: mongo
restart: always
ports:
- "27017:27017"
backend:
depends_on:
- mongo
build: .