Skip to content

Commit 9d3f60b

Browse files
committed
resolving a few bigs
1 parent 03acf18 commit 9d3f60b

File tree

14 files changed

+77
-6843
lines changed

14 files changed

+77
-6843
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ src_env/
55
__pycache__/
66
*.py[cod]
77
*$py.class
8+
.ruff_cache
89

910
# C extensions
1011
*.so

src/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
FROM python:3.11
22

3-
WORKDIR /code
3+
WORKDIR /app
44

55
COPY requirements.txt .
66

77
RUN pip3 install -r requirements.txt
88

9-
COPY . .
9+
COPY . /app
1010

1111
EXPOSE 5000
12-
13-
ENTRYPOINT ["gunicorn", "-c", "gunicorn.conf.py", "app:app"]
12+
ENTRYPOINT [ "python3", "api/app.py" ]

src/api/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
from flask import Flask
2-
3-
4-
def create_app():
5-
app = Flask(__name__)
6-
7-
from . import generate_name # noqa
8-
9-
app.register_blueprint(generate_name.bp)
10-
11-
return app

src/api/app.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from flask import Flask, jsonify
2+
import randomname
3+
4+
app = Flask(__name__)
5+
6+
@app.route('/')
7+
def hello_world():
8+
# Generate a random name including a first name and adjective
9+
random_name = randomname.generate()
10+
json = {"name": random_name}
11+
return jsonify(json)
12+
13+
if __name__ == '__main__':
14+
app.run(debug=True,host='0.0.0.0')

0 commit comments

Comments
 (0)