Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wakefield-movie-recommender
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Sauerburger
wakefield-movie-recommender
Compare revisions
8f09a8f783e85eef804573e7407cf39608d05730 to 1c6395755a8d1cd861c235e516bda1e9ed9a9f46
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
frank/wakefield-movie-recommender
Select target project
No results found
1c6395755a8d1cd861c235e516bda1e9ed9a9f46
Select Git revision
Branches
main
Swap
Target
frank/wakefield-movie-recommender
Select target project
frank/wakefield-movie-recommender
1 result
8f09a8f783e85eef804573e7407cf39608d05730
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
Improve code quality
· eeff530c
Frank Sauerburger
authored
2 years ago
Verified
eeff530c
Improve fallback path
· 10b0035c
Frank Sauerburger
authored
2 years ago
Verified
10b0035c
Dockerize app
· 1c639575
Frank Sauerburger
authored
2 years ago
Verified
1c639575
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+14
-0
14 additions, 0 deletions
Dockerfile
Makefile
+7
-0
7 additions, 0 deletions
Makefile
app.py
+6
-5
6 additions, 5 deletions
app.py
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
with
28 additions
and
5 deletions
Dockerfile
0 → 100644
View file @
1c639575
FROM
python:3.10
RUN
useradd
-m
app
WORKDIR
/home/app
COPY
requirements.txt requirements.txt
RUN
pip
install
-r
requirements.txt
COPY
app.py qgram.py /home/app/
COPY
examples/titles.json /home/app/examples/
RUN
chown
-R
root:app /home/app
RUN
chmod
-R
u
=
rX,g
=
rX,o
=
- /home/app
USER
app:app
ENTRYPOINT
["gunicorn", "-w", "4", "-b", "0.0.0.0", "app:app"]
This diff is collapsed.
Click to expand it.
Makefile
0 → 100644
View file @
1c639575
TAG
=
0.1.0
build
:
DOCKER_DEFAULT_PLATFORM
=
linux/amd64 docker build
-t
gitlab.sauerburger.com:5049/frank/wakefield-movie-recommender:
$(
TAG
)
.
push
:
build
DOCKER_DEFAULT_PLATFORM
=
linux/amd64 docker push gitlab.sauerburger.com:5049/frank/wakefield-movie-recommender:
$(
TAG
)
This diff is collapsed.
Click to expand it.
app.py
View file @
1c639575
...
...
@@ -9,7 +9,7 @@ import qgram
app
=
Flask
(
__name__
)
with
open
(
"
examples/titles.json
"
)
as
fileobj
:
with
open
(
"
examples/titles.json
"
,
encoding
=
"
utf-8
"
)
as
fileobj
:
titles
=
json
.
load
(
fileobj
)
index
=
qgram
.
QGramIndex
()
...
...
@@ -18,12 +18,13 @@ for title, _ in titles.values():
@app.route
(
"
/
"
)
def
suggest
():
"""
Serve movie title suggestions
"""
query
=
request
.
args
.
get
(
"
q
"
)
if
not
query
:
return
{}
results
=
[]
if
query
:
results
=
index
.
search
(
query
)
results
=
index
.
search
(
query
)
return
{
"
suggestions
"
:
results
[:
100
]
}
This diff is collapsed.
Click to expand it.
requirements.txt
View file @
1c639575
flask
~=2.1.2
gunicorn
~=20.1.0
This diff is collapsed.
Click to expand it.