mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-11 13:08:34 +03:00
Merge pull request #10 from bellingcat/dev-compose
This commit is contained in:
11
docker-compose.dev.yml
Normal file
11
docker-compose.dev.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
web:
|
||||
environment:
|
||||
- SERVE_LOCAL_ARCHIVE=/app/local_archive # See orchestration.yaml local_storage.save_to
|
||||
- ALLOWED_ORIGINS=http://localhost:8004
|
||||
redis:
|
||||
command: redis-server /conf/redis.conf
|
||||
ports:
|
||||
- 6379:6379
|
||||
@@ -33,15 +33,11 @@ services:
|
||||
|
||||
redis:
|
||||
image: redis:6-alpine
|
||||
# command: redis-server /conf/redis.conf # DEV ONLY
|
||||
command: redis-server /conf/redis.conf --requirepass ${REDIS_PASSWORD}
|
||||
volumes:
|
||||
- "./redis/data:/data"
|
||||
- "./redis/config:/conf"
|
||||
restart: always
|
||||
# DEV ONLY
|
||||
# ports:
|
||||
# - 6379:6379
|
||||
|
||||
dashboard:
|
||||
build: ./src
|
||||
|
||||
@@ -44,6 +44,11 @@ Instrumentator().instrument(app).expose(app, dependencies=[Depends(get_basic_aut
|
||||
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
|
||||
SERVE_LOCAL_ARCHIVE = os.environ.get("SERVE_LOCAL_ARCHIVE", "")
|
||||
if len(SERVE_LOCAL_ARCHIVE) > 1 and os.path.isdir(SERVE_LOCAL_ARCHIVE):
|
||||
logger.info(f"mounting local archive {SERVE_LOCAL_ARCHIVE}")
|
||||
app.mount(SERVE_LOCAL_ARCHIVE, StaticFiles(directory=SERVE_LOCAL_ARCHIVE), name=SERVE_LOCAL_ARCHIVE)
|
||||
|
||||
def get_db():
|
||||
session = SessionLocal()
|
||||
try: yield session
|
||||
@@ -186,4 +191,4 @@ async def on_startup():
|
||||
@repeat_every(seconds=60 * 60) # 1 hour
|
||||
async def on_startup():
|
||||
db: Session = next(get_db())
|
||||
crud.upsert_user_groups(db)
|
||||
crud.upsert_user_groups(db)
|
||||
|
||||
Reference in New Issue
Block a user