Merge pull request 'backoffice' (#4) from backoffice into master
Reviewed-on: #4
This commit is contained in:
commit
e658ccba8b
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM python:3.11.6-alpine3.18
|
||||
WORKDIR /app
|
||||
|
||||
COPY requierements.txt /app/
|
||||
COPY app /app/app
|
||||
|
||||
|
||||
RUN pip install --upgrade pip && pip install -r requierements.txt
|
||||
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
@ -12,8 +12,10 @@ app.include_router(mail.router)
|
||||
|
||||
@app.on_event("startup")
|
||||
async def startup_event():
|
||||
user_add.add(username="Peter93", password="toto", roles="Admin")
|
||||
user_add.add(username="Robert80", password="titi", roles="User")
|
||||
if len(os.environ["USERNAME_ADMIN"]) > 0 and len(os.environ["PASSWORD_ADMIN"]) > 0:
|
||||
user_add.add(username=os.environ["USERNAME_ADMIN"], password=os.environ["PASSWORD_ADMIN"], roles="Admin")
|
||||
if len(os.environ["USERNAME_TEST"]) > 0 and len(os.environ["PASSWORD_TEST"]) > 0:
|
||||
user_add.add(username=os.environ["USERNAME_TEST"], password=os.environ["PASSWORD_TEST"], roles="User")
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
|
Loading…
x
Reference in New Issue
Block a user