Port 8051 et ajout Dockerfile

This commit is contained in:
Francois Pelletier 2023-01-04 21:46:26 -05:00
parent 8e7483152a
commit 3e05e72a97
5 changed files with 28 additions and 3 deletions

16
Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM python:3.10-slim
EXPOSE 8051
WORKDIR /app
# Install the app's dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the app's code
COPY main.py .
# Set the entrypoint to run the app
ENTRYPOINT [ "streamlit", "run" ]
CMD [ "main.py", "--server.port=8080", "--server.headless", "true", "--server.fileWatcherType", "none", "--browser.gatherUsageStats", "false"]

1
build-local.sh Normal file
View file

@ -0,0 +1 @@
docker build -t local/fabriquedoc-frontend .

8
docker-run.sh Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/zsh
#!/usr/bin/zsh
docker stop fabriquedoc-frontend
docker rm fabriquedoc-frontend
# Ce programme sert à lancer le job_dispatcher dans un docker localement pour tester
docker run -p 8051:8051 -e FABRIQUEDOC_ENDPOINT=0.0.0.0:8080 --name fabriquedoc-frontend --network host local/fabriquedoc-frontend

View file

@ -24,7 +24,7 @@ import os
st.title("Fabrique à documents")
fabriquedoc_endpoint = os.environ.get("FABRIQUEDOC_ENDPOINT", "http://0.0.0.0:8000")
fabriquedoc_endpoint = os.environ.get("FABRIQUEDOC_ENDPOINT", "http://0.0.0.0:8051")
tab1, tab2, tab3 = st.tabs(["Markdown", "Aperçu", "Paramètres"])

4
run.sh
View file

@ -1,2 +1,2 @@
export FABRIQUEDOC_ENDPOINT="http://0.0.0.0:8000"
streamlit run main.py
export FABRIQUEDOC_ENDPOINT="http://0.0.0.0:8051"
streamlit run main.py --server.port=8051