Spaces:
Running
Running
Add Dockerfile for application setup and dependencies
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.12
|
2 |
+
|
3 |
+
# Install git
|
4 |
+
RUN apt-get update && apt-get install -y git
|
5 |
+
|
6 |
+
# Copy uv from astral-sh image
|
7 |
+
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
|
8 |
+
|
9 |
+
# Set up a new user named "user"
|
10 |
+
RUN useradd -m -u 1000 user
|
11 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
12 |
+
ENV UV_SYSTEM_PYTHON=1
|
13 |
+
|
14 |
+
# Create work directory
|
15 |
+
WORKDIR /app
|
16 |
+
|
17 |
+
# Clone the private repo using the GitHub token
|
18 |
+
# We'll use build arguments and ARGs to pass the token
|
19 |
+
ARG GITHUB_TOKEN
|
20 |
+
ARG REPO_URL="github.com/Jhsmit/instagibbs.git"
|
21 |
+
|
22 |
+
# Clone the repo
|
23 |
+
RUN git clone https://${GITHUB_TOKEN}@${REPO_URL} instagibbs
|
24 |
+
|
25 |
+
# Install requirements
|
26 |
+
WORKDIR /app/instagibbs
|
27 |
+
RUN uv pip install -e .
|
28 |
+
|
29 |
+
# Switch to non-root user
|
30 |
+
USER user
|
31 |
+
|
32 |
+
# Run the app
|
33 |
+
CMD ["solara", "run", "instagibbs/web/app.py", "--host", "0.0.0.0", "--port", "7860"]
|