Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Rahkakavee Baskaran
commited on
Commit
•
9d99594
1
Parent(s):
c2134a0
add Docker set up and app file
Browse files- Dockerfile +32 -0
- src/__init__.py +0 -0
- src/app.py +3 -0
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
ENV POETRY_VERSION=1.6.1
|
6 |
+
RUN pip install "poetry==$POETRY_VERSION"
|
7 |
+
|
8 |
+
RUN poetry config virtualenvs.create false
|
9 |
+
|
10 |
+
COPY ./poetry.lock /app/poetry.lock
|
11 |
+
COPY ./pyproject.toml /app/pyproject.toml
|
12 |
+
RUN poetry install --no-dev
|
13 |
+
|
14 |
+
# User
|
15 |
+
RUN useradd -m -u 1000 user
|
16 |
+
USER user
|
17 |
+
ENV HOME /home/user
|
18 |
+
ENV PATH $HOME/.local/bin:$PATH
|
19 |
+
|
20 |
+
WORKDIR $HOME
|
21 |
+
RUN mkdir app
|
22 |
+
WORKDIR $HOME/app
|
23 |
+
COPY . $HOME/app
|
24 |
+
|
25 |
+
RUN --mount=type=secret,id=OPEN_API_KEY,mode=0444,required=true
|
26 |
+
|
27 |
+
EXPOSE 8501
|
28 |
+
CMD streamlit run src/app.py \
|
29 |
+
--server.headless true \
|
30 |
+
--server.enableCORS false \
|
31 |
+
--server.enableXsrfProtection false \
|
32 |
+
--server.fileWatcherType none
|
src/__init__.py
ADDED
File without changes
|
src/app.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
st.title("Hello World!")
|