Skip to content

Commit

Permalink
update for new image
Browse files Browse the repository at this point in the history
  • Loading branch information
Patent2net committed Apr 6, 2023
1 parent 2e50c19 commit 5610868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions p2n/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ def run_script(script, configfile, directory='Patent2Net'):
# Compute command
command = 'python {script} {configfile}'.format(script=script, configfile=configfile)
logger.info('Running command "{}"'.format(command))

env = os.environ.copy()
env["FLASK_APP"] = "app.py"
env["FLASK_ENV"] = "production"
env["PATH"] = "/vpy3/bin/:" + env["PATH"]
# Run process
process = subprocess.Popen(command, shell=True, bufsize=1, cwd=directory)
process = subprocess.Popen(command, shell=True, bufsize=1, cwd=directory, env=env)

# Poll process for new output until finished
while True:
Expand Down
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source /vpy3/bin/activate
export PATH="$PATH:/vpy3/bin"
export FLASK_APP=app.py
flask run --host=0.0.0.0

0 comments on commit 5610868

Please sign in to comment.