Added query string as configurable (Docker) environment variable
This commit is contained in:
@@ -14,6 +14,8 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
||||
# the application crashes without emitting any logs due to buffering.
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
ENV ARXIV_QUERY=""
|
||||
|
||||
# Install required binary packages.
|
||||
RUN apt-get update && apt-get install -y \
|
||||
imagemagick \
|
||||
|
||||
@@ -9,6 +9,7 @@ import time
|
||||
import random
|
||||
import logging
|
||||
import argparse
|
||||
import os
|
||||
|
||||
from aslite.arxiv import get_response, parse_response
|
||||
from aslite.db import get_papers_db, get_metas_db
|
||||
@@ -30,6 +31,9 @@ if __name__ == '__main__':
|
||||
"""
|
||||
|
||||
# query string of papers to look for
|
||||
q = os.environ.get('ARXIV_QUERY', '')
|
||||
if not q:
|
||||
print("No query string provided, will use default.")
|
||||
q = 'cat:cs.CV+OR+cat:cs.LG+OR+cat:cs.CL+OR+cat:cs.AI+OR+cat:cs.NE+OR+cat:cs.RO+OR+cat:cs.AR+OR+cat:cs.DC'
|
||||
|
||||
pdb = get_papers_db(flag='c')
|
||||
|
||||
+2
-2
@@ -16,7 +16,8 @@ services:
|
||||
volumes:
|
||||
- /Users/schihei/git/arxiv-sanity-lite/container-data/data/:/app/data
|
||||
- /Users/schihei/git/arxiv-sanity-lite/container-data/static/thumb/:/app/static/thumb
|
||||
|
||||
environment:
|
||||
- ARXIV_QUERY=cat:cs.CV+OR+cat:cs.LG+OR+cat:cs.CL+OR+cat:cs.AI+OR+cat:cs.NE+OR+cat:cs.RO+OR+cat:cs.AR+OR+cat:cs.DC
|
||||
# The commented out section below is an example of how to define a PostgreSQL
|
||||
# database that your application can use. `depends_on` tells Docker Compose to
|
||||
# start the database before your application. The `db-data` volume persists the
|
||||
@@ -49,4 +50,3 @@ services:
|
||||
# secrets:
|
||||
# db-password:
|
||||
# file: db/password.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user