Browse Source

edit dockerfile and app.py

master
phamduchongan93 8 months ago
parent
commit
2e84b12461
3 changed files with 9 additions and 3 deletions
  1. +1
    -1
      Dockerfile
  2. +4
    -2
      app.py
  3. +4
    -0
      requirements.txt

+ 1
- 1
Dockerfile View File

@ -24,4 +24,4 @@ VOLUME /app/static
EXPOSE 5000
# Command to run the application
CMD ["python", "app.py"]
CMD python3 app.py

+ 4
- 2
app.py View File

@ -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)

+ 4
- 0
requirements.txt View File

@ -0,0 +1,4 @@
Flask==2.0.1
qrcode==7.3
Pillow==8.3.1
Werkzeug==2.0.1

Loading…
Cancel
Save