Skip to content

Commit cd588c6

Browse files
committed
fix: new dockerfile atf deploy
1 parent 2a91b91 commit cd588c6

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

Dockerfile.Artefact

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM python:3.8-slim-buster
2+
3+
ENV LANG=C.UTF-8 \
4+
LC_ALL=C.UTF-8
5+
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends \
8+
curl build-essential \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
RUN useradd -d /home/docker_user -m -s /bin/bash docker_user
12+
USER docker_user
13+
14+
RUN mkdir -p /home/docker_user/workspace
15+
WORKDIR /home/docker_user/workspace
16+
17+
# Install Poetry
18+
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/install.python-poetry.org/main/install-poetry.py | POETRY_HOME=/home/docker_user/poetry python
19+
20+
ENV PATH="${PATH}:/home/docker_user/.poetry/bin:/home/docker_user/poetry/bin"
21+
22+
COPY pyproject.toml ./
23+
COPY poetry.lock ./
24+
25+
RUN poetry install --no-root --no-dev
26+
27+
COPY . /home/docker_user/workspace/
28+
29+
EXPOSE 8080
30+
31+
# Set the entry point to run the Streamlit application
32+
ENTRYPOINT ["poetry", "run", "streamlit_prophet", "deploy", "dashboard-with-base-path"]

streamlit_prophet/app/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ def deploy_streamlit():
1313
"--server.address=0.0.0.0",
1414
]
1515
sys.exit(cli.main())
16+
17+
def deploy_streamlit_with_base_path():
18+
sys.argv = [
19+
"streamlit",
20+
"run",
21+
f"{os.path.dirname(os.path.realpath(__file__))}/dashboard.py",
22+
"--server.port=8080",
23+
"--server.address=0.0.0.0",
24+
"--server.baseUrlPath=/streamlit-prophet",
25+
]
26+
sys.exit(cli.main())

streamlit_prophet/cli/deploy.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import typer
22
from rich.console import Console
3-
from streamlit_prophet.app import deploy_streamlit
3+
from streamlit_prophet.app import deploy_streamlit, deploy_streamlit_with_base_path
44

55
app = typer.Typer()
66
console = Console()
@@ -10,3 +10,8 @@
1010
def dashboard() -> None:
1111
"""Deploys the streamlit dashboard."""
1212
deploy_streamlit()
13+
14+
@app.command()
15+
def dashboard_with_base_path() -> None:
16+
"""Deploys the streamlit dashboard with a base path."""
17+
deploy_streamlit_with_base_path()

0 commit comments

Comments
 (0)