diff --git a/Dockerfile b/Dockerfile index 5831998..2f66861 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,4 +24,4 @@ VOLUME /app/static EXPOSE 5000 # Command to run the application -CMD ["python", "app.py"] +CMD python3 app.py diff --git a/app.py b/app.py index c76e64a..4b55ab5 100755 --- a/app.py +++ b/app.py @@ -2,6 +2,8 @@ from flask import Flask, render_template import qrcode import os +from urllib.parse import quote +from PIL import Image app = Flask(__name__, template_folder="templates") @app.route('/') @@ -12,9 +14,9 @@ def index(): qr.make(fit=True) qr_img = qr.make_image(fill_color="black", back_color="white") qr_img = qr.make_image(fill_color="black", back_color="white") - qr_img.save("/home/anpham/Projects/virtual-bussiness-card/static/qr_code.png") # Save QR code image + qr_img.save("static/qr_code.png") # Save QR code image return render_template('index.html') if __name__ == '__main__': - app.run(debug=True) + app.run(host='0.0.0.0', port=5000) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1aef5c7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Flask==2.0.1 +qrcode==7.3 +Pillow==8.3.1 +Werkzeug==2.0.1