Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload Dockerfile
Browse files- Dockerfile +32 -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
|