mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-11 18:26:08 +00:00
feat: update docker compose to drop mongo
This commit is contained in:
@@ -57,8 +57,10 @@ async def retrieve_scrape_jobs(
|
|||||||
fetch_options: FetchOptions, user: User = Depends(get_current_user)
|
fetch_options: FetchOptions, user: User = Depends(get_current_user)
|
||||||
):
|
):
|
||||||
LOG.info(f"Retrieving jobs for account: {user.email}")
|
LOG.info(f"Retrieving jobs for account: {user.email}")
|
||||||
|
ATTRIBUTES = "chat" if fetch_options.chat else "*"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
job_query = "SELECT * FROM jobs WHERE user = ?"
|
job_query = f"SELECT {ATTRIBUTES} FROM jobs WHERE user = ?"
|
||||||
results = query(job_query, (user.email,))
|
results = query(job_query, (user.email,))
|
||||||
return JSONResponse(content=jsonable_encoder(results[::-1]))
|
return JSONResponse(content=jsonable_encoder(results[::-1]))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ services:
|
|||||||
dockerfile: docker/api/Dockerfile
|
dockerfile: docker/api/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
- LOG_LEVEL=INFO
|
- LOG_LEVEL=INFO
|
||||||
- MONGODB_URI=mongodb://root:example@webscrape-mongo:27017 # used to access MongoDB
|
|
||||||
- SECRET_KEY=your_secret_key # used to encode authentication tokens (can be a random string)
|
- SECRET_KEY=your_secret_key # used to encode authentication tokens (can be a random string)
|
||||||
- ALGORITHM=HS256 # authentication encoding algorithm
|
- ALGORITHM=HS256 # authentication encoding algorithm
|
||||||
- ACCESS_TOKEN_EXPIRE_MINUTES=600 # access token expire minutes
|
- ACCESS_TOKEN_EXPIRE_MINUTES=600 # access token expire minutes
|
||||||
@@ -31,17 +30,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
volumes:
|
volumes:
|
||||||
|
- "$PWD/data:/project/data"
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
mongo:
|
|
||||||
container_name: webscrape-mongo
|
|
||||||
image: mongo
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
MONGO_INITDB_ROOT_USERNAME: root
|
|
||||||
MONGO_INITDB_ROOT_PASSWORD: example
|
|
||||||
networks:
|
|
||||||
- web
|
|
||||||
networks:
|
networks:
|
||||||
web:
|
web:
|
||||||
|
|||||||
Reference in New Issue
Block a user