File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ RUN mkdir /mcr-install \
99
1010WORKDIR /mcr-install
1111
12- ENV MATLAB_RUNTIME_SHA256=" b821022690804e498d2e5ad814dccb64aab17c5e4bc10a1e2a12498ef5364e0d"
12+ ARG MATLAB_RUNTIME_SHA256=" b821022690804e498d2e5ad814dccb64aab17c5e4bc10a1e2a12498ef5364e0d"
13+ ENV MATLAB_RUNTIME_SHA256=${MATLAB_RUNTIME_SHA256}
1314
1415RUN wget https://ssd.mathworks.com/supportfiles/downloads/R2021a/Release/1/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2021a_Update_1_glnxa64.zip \
1516 && echo " ${MATLAB_RUNTIME_SHA256} MATLAB_Runtime_R2021a_Update_1_glnxa64.zip" | sha256sum -c -
Original file line number Diff line number Diff line change 1414
1515
1616app = Flask (__name__ )
17- app .secret_key = os .environ .get ("FLASK_SECRET_KEY" )
18- if not app .secret_key :
19- raise RuntimeError ("FLASK_SECRET_KEY environment variable not set" )
17+ secret_key = os .environ .get ("FLASK_SECRET_KEY" )
18+ if not secret_key :
19+ # In production, require an explicit FLASK_SECRET_KEY to be set.
20+ # For local development and tests, fall back to a per-process random key
21+ # so that importing this module does not fail hard.
22+ if os .environ .get ("FLASK_ENV" ) == "production" :
23+ raise RuntimeError ("FLASK_SECRET_KEY environment variable not set in production" )
24+ secret_key = os .urandom (32 )
25+ app .secret_key = secret_key
2026
2127cors = CORS (app )
2228app .config ['CORS_HEADERS' ] = 'Content-Type'
@@ -410,5 +416,5 @@ def openJupyter():
410416
411417if __name__ == "__main__" :
412418 # In production, use:
413- # gunicorn -w 4 -b 0.0.0.0:5000 main:app
419+ # gunicorn -w 4 -b 0.0.0.0:5000 fri.server. main:app
414420 app .run (host = "0.0.0.0" , port = 5000 , debug = False )
You can’t perform that action at this time.
0 commit comments