Modified to reflect new folder structure.
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
@@ -8,10 +8,10 @@ USER user
|
|
8 |
|
9 |
# Clone aerospace-chatbot github repository
|
10 |
USER root
|
11 |
-
WORKDIR /
|
12 |
RUN apt-get update && \
|
13 |
apt-get install -y git
|
14 |
-
RUN git clone https://github.com/dan-s-mueller/aerospace_chatbot.git .
|
15 |
|
16 |
# Set home to the user's home directory
|
17 |
USER user
|
@@ -20,6 +20,7 @@ ENV HOME=/home/user \
|
|
20 |
WORKDIR $HOME
|
21 |
|
22 |
# Create directories for the app code to be copied into
|
|
|
23 |
RUN mkdir -p $HOME/src
|
24 |
RUN mkdir -p $HOME/data
|
25 |
RUN mkdir -p $HOME/config
|
@@ -28,7 +29,7 @@ RUN mkdir -p $HOME/config
|
|
28 |
RUN pip3 install poetry==1.7.1
|
29 |
|
30 |
# Copy poetry files from repo into home
|
31 |
-
RUN cp /
|
32 |
RUN chown user:user $HOME/pyproject.toml $HOME/poetry.lock*
|
33 |
|
34 |
# Disable virtual environments creation by Poetry as the Docker container itself is an isolated environment
|
@@ -41,10 +42,10 @@ RUN poetry config virtualenvs.path $HOME/.venv
|
|
41 |
ENV PATH="$HOME/.venv/bin:$PATH"
|
42 |
|
43 |
# Install dependencies using Poetry
|
44 |
-
RUN poetry install --no-
|
45 |
|
46 |
# Copy the rest of the repo into home
|
47 |
-
RUN cp -R /
|
48 |
RUN chown -R user:user $HOME/src $HOME/data $HOME/config
|
49 |
|
50 |
# Expose the port Streamlit runs on
|
@@ -54,7 +55,7 @@ EXPOSE 8501
|
|
54 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
55 |
|
56 |
# Update working directory to be consistent with where Start.py is
|
57 |
-
WORKDIR $HOME/
|
58 |
|
59 |
# An ENTRYPOINT allows you to configure a container that will run as an executable. Here, it also contains the entire streamlit run command for your app, so you don’t have to call it from the command line
|
60 |
ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
@@ -63,6 +64,6 @@ ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.addre
|
|
63 |
# docker build -t ams-chatbot .
|
64 |
# docker run -p 8501:8501 ams-chatbot
|
65 |
|
66 |
-
# To run remotely
|
67 |
# docker run -it -p 7860:7860 --platform=linux/amd64 \
|
68 |
# registry.hf.space/ai-aerospace-aerospace-chatbots:latest
|
|
|
8 |
|
9 |
# Clone aerospace-chatbot github repository
|
10 |
USER root
|
11 |
+
WORKDIR /clonedir
|
12 |
RUN apt-get update && \
|
13 |
apt-get install -y git
|
14 |
+
RUN git clone --depth 1 https://github.com/dan-s-mueller/aerospace_chatbot.git .
|
15 |
|
16 |
# Set home to the user's home directory
|
17 |
USER user
|
|
|
20 |
WORKDIR $HOME
|
21 |
|
22 |
# Create directories for the app code to be copied into
|
23 |
+
RUN mkdir -p $HOME/app
|
24 |
RUN mkdir -p $HOME/src
|
25 |
RUN mkdir -p $HOME/data
|
26 |
RUN mkdir -p $HOME/config
|
|
|
29 |
RUN pip3 install poetry==1.7.1
|
30 |
|
31 |
# Copy poetry files from repo into home
|
32 |
+
RUN cp /clonedir/pyproject.toml /clonedir/poetry.lock* $HOME
|
33 |
RUN chown user:user $HOME/pyproject.toml $HOME/poetry.lock*
|
34 |
|
35 |
# Disable virtual environments creation by Poetry as the Docker container itself is an isolated environment
|
|
|
42 |
ENV PATH="$HOME/.venv/bin:$PATH"
|
43 |
|
44 |
# Install dependencies using Poetry
|
45 |
+
RUN poetry install --no-root
|
46 |
|
47 |
# Copy the rest of the repo into home
|
48 |
+
RUN cp -R /clonedir/src /clonedir/data /clonedir/config /clonedir/app $HOME
|
49 |
RUN chown -R user:user $HOME/src $HOME/data $HOME/config
|
50 |
|
51 |
# Expose the port Streamlit runs on
|
|
|
55 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
56 |
|
57 |
# Update working directory to be consistent with where Start.py is
|
58 |
+
WORKDIR $HOME/app
|
59 |
|
60 |
# An ENTRYPOINT allows you to configure a container that will run as an executable. Here, it also contains the entire streamlit run command for your app, so you don’t have to call it from the command line
|
61 |
ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
64 |
# docker build -t ams-chatbot .
|
65 |
# docker run -p 8501:8501 ams-chatbot
|
66 |
|
67 |
+
# To run remotely from hugging face spaces
|
68 |
# docker run -it -p 7860:7860 --platform=linux/amd64 \
|
69 |
# registry.hf.space/ai-aerospace-aerospace-chatbots:latest
|