Spaces:
Running
Running
Commit
·
e6889e1
1
Parent(s):
7de8a17
fix dockerfile (#1)
Browse files- fix dockerfile (a1f9dfb6fc5e368131c1a17ce920e54b31b27f08)
- Update execution.sh (f95802470cb3550dc76cb618873359851cbb42ab)
- Update app.py (11aa8f0f2230f6ab4252dcb6ca030bc9dd06c33d)
Co-authored-by: Radamés Ajna <radames@users.noreply.huggingface.co>
- Dockerfile +12 -2
- app.py +1 -1
- execution.sh +2 -2
Dockerfile
CHANGED
@@ -25,22 +25,32 @@ ENV POSTGRES_USER=postgres
|
|
25 |
ENV POSTGRES_PASSWORD=pwd
|
26 |
ENV POSTGRES_DB=sorbobot
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
# Install PGVector
|
29 |
WORKDIR /tmp
|
30 |
RUN git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git
|
31 |
WORKDIR /tmp/pgvector
|
32 |
RUN make
|
33 |
RUN make install # may need sudo
|
34 |
-
WORKDIR
|
|
|
35 |
|
36 |
COPY "execution.sh" "/usr/local/bin/"
|
37 |
|
38 |
COPY ./docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
|
39 |
|
|
|
|
|
|
|
|
|
40 |
ENTRYPOINT ["execution.sh"]
|
41 |
|
42 |
STOPSIGNAL SIGINT
|
43 |
|
44 |
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
45 |
|
46 |
-
CMD ["postgres"]
|
|
|
25 |
ENV POSTGRES_PASSWORD=pwd
|
26 |
ENV POSTGRES_DB=sorbobot
|
27 |
|
28 |
+
# User
|
29 |
+
RUN useradd -m -u 1000 user
|
30 |
+
ENV HOME /home/user
|
31 |
+
ENV PATH $HOME/.local/bin:$PATH
|
32 |
+
|
33 |
# Install PGVector
|
34 |
WORKDIR /tmp
|
35 |
RUN git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git
|
36 |
WORKDIR /tmp/pgvector
|
37 |
RUN make
|
38 |
RUN make install # may need sudo
|
39 |
+
WORKDIR $HOME
|
40 |
+
COPY ./ $HOME
|
41 |
|
42 |
COPY "execution.sh" "/usr/local/bin/"
|
43 |
|
44 |
COPY ./docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
|
45 |
|
46 |
+
RUN chown -R user:user /var/lib/postgresql/data
|
47 |
+
|
48 |
+
USER user
|
49 |
+
|
50 |
ENTRYPOINT ["execution.sh"]
|
51 |
|
52 |
STOPSIGNAL SIGINT
|
53 |
|
54 |
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
55 |
|
56 |
+
CMD ["postgres"]
|
app.py
CHANGED
@@ -17,7 +17,7 @@ from css import load_css
|
|
17 |
from custom_pgvector import CustomPGVector
|
18 |
from message import Message
|
19 |
|
20 |
-
CONNECTION_STRING = "postgresql+psycopg2://postgres@/sorbobot?host=
|
21 |
|
22 |
st.set_page_config(layout="wide")
|
23 |
|
|
|
17 |
from custom_pgvector import CustomPGVector
|
18 |
from message import Message
|
19 |
|
20 |
+
CONNECTION_STRING = "postgresql+psycopg2://postgres@/sorbobot?host=0.0.0.0"
|
21 |
|
22 |
st.set_page_config(layout="wide")
|
23 |
|
execution.sh
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
#!/usr/bin/env bash
|
2 |
|
3 |
bash /usr/local/bin/docker-entrypoint.sh "$@" &
|
4 |
-
|
5 |
sleep 2
|
6 |
|
7 |
-
streamlit run app.py --server.port=7860 --server.address=0.0.0.0
|
|
|
1 |
#!/usr/bin/env bash
|
2 |
|
3 |
bash /usr/local/bin/docker-entrypoint.sh "$@" &
|
4 |
+
postgres &
|
5 |
sleep 2
|
6 |
|
7 |
+
streamlit run app.py --server.port=7860 --server.address=0.0.0.0
|