Feat(back): add livereload and start config
This commit is contained in:
parent
a92383f7d0
commit
eb97abee7f
@ -37,5 +37,5 @@ RUN poetry install
|
|||||||
FROM set_poetry as app_ready
|
FROM set_poetry as app_ready
|
||||||
|
|
||||||
#EXPOSE 80
|
#EXPOSE 80
|
||||||
COPY src/ .
|
COPY src/ src
|
||||||
CMD ["poetry", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["poetry", "run", "uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
from ..config import config
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/months")
|
||||||
async def root():
|
async def get_months():
|
||||||
return {"message": "Hello World"}
|
print(config)
|
||||||
|
return {"message": "plop"}
|
||||||
|
9
backend/src/config.py
Normal file
9
backend/src/config.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
config = {}
|
||||||
|
|
||||||
|
try:
|
||||||
|
config["datapath"] = os.environ["DATASPATH"]
|
||||||
|
except KeyError:
|
||||||
|
config["datapath"] = "/datas"
|
||||||
|
|
11
docker-compose_live.yml
Normal file
11
docker-compose_live.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
back:
|
||||||
|
build: ./backend
|
||||||
|
ports:
|
||||||
|
- 8000:8000
|
||||||
|
volumes:
|
||||||
|
- ./backend/src:/app/src
|
||||||
|
- ./datas:/datas
|
Loading…
Reference in New Issue
Block a user