File tree Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Expand file tree Collapse file tree 4 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,10 @@ RUN chmod -R 777 /app/static
38
38
COPY . /paws-data-pipeline/server
39
39
40
40
RUN chmod 777 /paws-data-pipeline/server
41
+
42
+ RUN chmod +x bin/startServer.sh
41
43
# RUN ufw allow 5000
42
44
WORKDIR /app
43
45
44
- # --uid uwsgi
45
- CMD uwsgi --http-socket :5000 --plugin python38 --module wsgi:app --chdir /app --pythonpath .
46
- # we may want to switch this to a script which logs output, etc?
47
-
48
- RUN set FLASK_APP=server/app.py
49
- RUN export FLASK_APP
50
-
51
- # This abomination ensures that the PG server has finished its restart cycle
52
- CMD echo "SLEEPING 10" ; sleep 10; echo "WAKING" ; alembic upgrade head ; python -m flask run --host=0.0.0.0 --no-reload
53
-
54
- # --no-reload prevents Flask restart, which usually happens in middle of create_base_users()
55
- # TODO: SECURITY - ensure we are not running in debug mode in production
46
+ CMD bin/startServer.sh
47
+ # >> start.log 2>&1
Original file line number Diff line number Diff line change 13
13
jwt = JWTManager (app )
14
14
15
15
16
- # def create_app():
17
16
app .secret_key = APP_SECRET_KEY
18
17
app .config ["MAX_CONTENT_LENGTH" ] = 500 * 1024 * 1024 # 500 Megs
19
18
app .config ["SEND_FILE_MAX_AGE_DEFAULT" ] = 0
Original file line number Diff line number Diff line change
1
+
2
+ # we may want to switch this to a script which logs output, etc?
3
+ echo " ------------STARTING ` date` ------------------"
4
+ set FLASK_APP=server/app.py
5
+ export FLASK_APP
6
+
7
+ # This abomination ensures that the PG server has finished its restart cycle
8
+ echo " SLEEPING.. WAITING FOR DB" ; sleep 5; echo " WAKING" ; alembic upgrade head; echo " DB SETUP" ;
9
+ # ; python -m flask run --host=0.0.0.0 --no-reload
10
+
11
+ # --no-reload prevents Flask restart, which usually happens in middle of create_base_users()
12
+ # TODO: SECURITY - ensure we are not running in debug mode in production
13
+ uwsgi --http-socket :5000 --plugin python38 --module wsgi:app --chdir /app --pythonpath .
Original file line number Diff line number Diff line change 1
- from app import create_app
2
-
3
- app = create_app ()
1
+ from app import app
4
2
5
3
if __name__ == "__main__" :
6
4
app .run ()
You can’t perform that action at this time.
0 commit comments