Commit c7776171 authored by Manuel's avatar Manuel

Merge remote-tracking branch 'origin/feature/authentication' into feature/authentication

parents 79b47008 1d92de52
......@@ -6,7 +6,7 @@ info:
# Import security definitions from global security definition
securityDefinitions:
$ref: '../../../../modules/security/security.yml#securityDefinitions'
$ref: '../security/security.yml#securityDefinitions'
consumes:
- "application/json"
......
......@@ -26,7 +26,11 @@ def api_root():
return 'Endpoint of role-stage-discovery-microservice!'
# SSL configuration
context = (f'{modules_path}/certificate/articonf1.crt', f'{modules_path}/certificate/articonf1.key') # certificate and key files
try:
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
# start app
if __name__ == '__main__':
......
......@@ -39,6 +39,7 @@ requests==2.22.0
rope==0.16.0
scikit-learn==0.22.1
scipy==1.4.1
semver==2.10.2
six==1.14.0
swagger-ui-bundle==0.0.6
typed-ast==1.4.1
......
......@@ -32,6 +32,14 @@ spec:
image: alexx882/role-stage-discovery-microservice
ports:
- containerPort: 5000
volumeMounts:
- mountPath: /srv/articonf
name: articonf
volumes:
- name: articonf
hostPath:
path: /srv/articonf
type: Directory
---
apiVersion: v1
kind: Service
......
......@@ -17,4 +17,8 @@ COPY main.py /app/
COPY templates/ /app/templates/
RUN chmod a+x main.py
CMD ["python", "./main.py"]
\ No newline at end of file
CMD ["python", "./main.py"]
# 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')
app.run(host='0.0.0.0', port=5000, debug=True)
\ No newline at end of file
# SSL configuration
try:
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
app.run(host='0.0.0.0', 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