-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added improved base structure with dependencies.
- Loading branch information
Showing
12 changed files
with
268 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
FROM python:3.8.2-alpine3.11 | ||
|
||
RUN apk add --no-cache git | ||
RUN apk add --no-cache git \ | ||
&& pip install --upgrade pip \ | ||
&& adduser -D worker \ | ||
&& pip install pipenv | ||
|
||
USER worker | ||
|
||
WORKDIR /home/worker | ||
|
||
ENV PATH="/home/worker/.local/bin:${PATH}" | ||
|
||
COPY --chown=worker:worker Pipfile Pipfile | ||
RUN pipenv lock -r > requirements.txt | ||
RUN pip install --user -r requirements.txt | ||
|
||
COPY --chown=worker:worker . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tty: | ||
docker exec --user="worker" -ti fileindexerapi_file-indexer-api_1 /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
pylint = "*" | ||
|
||
[packages] | ||
flask = "*" | ||
flask-restful = "*" | ||
py4j = "*" | ||
|
||
[requires] | ||
python_version = "3.8" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from app import app | ||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from flask import Flask | ||
from flask_restful import Api | ||
from controllers.indexer_controller import IndexerController | ||
from controllers.search_controller import SearchController | ||
|
||
app = Flask(__name__) | ||
api = Api(app) | ||
|
||
api.add_resource(IndexerController, '/index') | ||
api.add_resource(SearchController, '/search') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from flask_restful import Resource, reqparse | ||
|
||
parser = reqparse.RequestParser() | ||
parser.add_argument('path') | ||
|
||
class IndexerController(Resource): | ||
def post(self): | ||
args = parser.parse_args() | ||
|
||
return {'path': args['path']} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from flask_restful import Resource, reqparse | ||
|
||
class SearchController(Resource): | ||
def get(self): | ||
return {'message': 'SearchController'} |
Empty file.
Empty file.
Empty file.