fix
This commit is contained in:
parent
41045fdf3a
commit
cc56dec270
3 changed files with 5 additions and 10 deletions
|
|
@ -29,10 +29,6 @@ RUN adduser --disabled-password --gecos "" appuser \
|
|||
|
||||
USER appuser
|
||||
|
||||
# Default cache dir (override with TEXTS_CACHE_DIR env if you want)
|
||||
ENV DB_DIR=/usr/src/app/db
|
||||
RUN mkdir -p "$DB_DIR"
|
||||
|
||||
# Expose the service port
|
||||
EXPOSE 5000
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ def track():
|
|||
ua = str(request.args.get('ua'))
|
||||
url = str(request.values.get("url") or request.headers.get("Referer"))
|
||||
|
||||
if os.path.exists('db/db.json'):
|
||||
with open('db/db.json', 'r') as db:
|
||||
if os.path.exists('db.json'):
|
||||
with open('db.json', 'r') as db:
|
||||
db = json.loads(db.read())
|
||||
else:
|
||||
db = {}
|
||||
|
|
@ -45,7 +45,7 @@ def track():
|
|||
|
||||
send_msg(f'User <{hash}> visited { url } on { ua } ({ str(len(db[hash][cat])) })')
|
||||
|
||||
with open('db/db.json', 'w+') as dbw:
|
||||
with open('db.json', 'w+') as dbw:
|
||||
dbw.write(json.dumps(db, indent=4))
|
||||
|
||||
return str(len(db[hash][cat]))
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
services:
|
||||
wordonaut:
|
||||
tagbot:
|
||||
build: .
|
||||
container_name: tagbot
|
||||
ports:
|
||||
- "8001:5000"
|
||||
environment:
|
||||
- FLASK_APP=wordonaut.py
|
||||
- FLASK_APP=db.py
|
||||
- FLASK_RUN_HOST=0.0.0.0
|
||||
volumes:
|
||||
- .:/usr/src/app
|
||||
Loading…
Add table
Add a link
Reference in a new issue