This commit is contained in:
Baptiste Peupier 2022-02-02 13:18:09 +01:00
parent cbba65f450
commit 4cd8c65524
3 changed files with 7 additions and 11 deletions

View file

@ -1,6 +1,4 @@
print("Import Flask")
from flask import Flask
print("Import Flask-Cors")
from flask_cors import CORS
@ -9,7 +7,7 @@ def create_app(flask_env='development'):
app = Flask(__name__, instance_relative_config=False, static_url_path='')
origin = app.config.get('ALLOW_ORIGIN')
if origin is None:
origin = ['http://10.1.1.10', 'http://10.1.5.10']
origin = ['http://10.1.1.10']
CORS(app, supports_credentials=True, origins=origin)
if flask_env == 'production':
app.config.from_object("config.ProductionConfig")

View file

@ -21,9 +21,9 @@ http {
server frontend:4200;
}
# upstream flask-frontend {
# server flask-frontend:5000;
# }
upstream flask-frontend {
server flask-frontend:5000;
}
server {
@ -34,9 +34,9 @@ http {
proxy_pass http://frontend;
}
# location /api {
# proxy_pass http://flask-frontend;
# }
location /api {
proxy_pass http://flask-frontend;
}
}
}

View file

@ -38,8 +38,6 @@ services:
- FLASK_ENV=production
- FLASK_DEBUG=0
- FLASK_RUN_PORT=5000
ports:
- "5000:5000"
networks:
- net
depends_on: