Commit 50587721 authored by Alexander Lercher's avatar Alexander Lercher

secured homepage with ssl

parent 3051a5d2
......@@ -17,4 +17,8 @@ COPY /app/
COPY templates/ /app/templates/
RUN chmod a+x
CMD ["python", "./"]
\ No newline at end of file
CMD ["python", "./"]
# docker build -t alexx882/hello-articonf .
# docker run --name articonf-home -p 80:5000 -v /srv/articonf:/srv/articonf -d alexx882/hello-articonf
# docker run --name articonf-home-ssl -p 443:5000 -v /srv/articonf:/srv/articonf -d alexx882/hello-articonf
\ No newline at end of file
import os
from flask import Flask, render_template
app = Flask(__name__)
......@@ -6,4 +7,11 @@ app = Flask(__name__)
def hello_world():
return render_template('index.html')'', port=5000, debug=True)
\ No newline at end of file
# SSL configuration
certificate_path = os.environ['ARTICONF_CERTIFICATE_PATH']
except KeyError:
certificate_path = '/srv/articonf/'
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files'', port=5000, debug=False, ssl_context=context)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment