Spaces:
Runtime error
Runtime error
Rob McKnight commited on
Commit ·
ef72ee0
1
Parent(s): c8e408e
please
Browse files- Dockerfile +23 -4
Dockerfile
CHANGED
|
@@ -8,6 +8,18 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
RUN python3 -m venv /opt/venv
|
| 12 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 13 |
|
|
@@ -17,14 +29,21 @@ COPY requirements.txt requirements.txt
|
|
| 17 |
COPY tutorial.py tutorial.py
|
| 18 |
RUN pip install --break-system-packages -r requirements.txt
|
| 19 |
|
| 20 |
-
|
| 21 |
-
EXPOSE 7860
|
| 22 |
-
|
| 23 |
RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
|
| 24 |
cd /mnt/workspace && \
|
| 25 |
git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
|
| 26 |
|
|
|
|
| 27 |
COPY start.sh /start.sh
|
| 28 |
|
| 29 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
CMD ["/start.sh"]
|
|
|
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Create user and all necessary directories
|
| 12 |
+
RUN useradd -u 1000 -m appuser && \
|
| 13 |
+
mkdir -p /app /mnt/workspace && \
|
| 14 |
+
# Create rust-analyzer directories
|
| 15 |
+
mkdir -p /home/appuser/.cache/rust-analyzer && \
|
| 16 |
+
mkdir -p /home/appuser/.config/rust-analyzer && \
|
| 17 |
+
# Create marimo directories
|
| 18 |
+
mkdir -p /home/appuser/.cache/marimo && \
|
| 19 |
+
mkdir -p /home/appuser/.config/marimo && \
|
| 20 |
+
mkdir -p /home/appuser/.local/share/marimo
|
| 21 |
+
|
| 22 |
+
# Set up Python environment
|
| 23 |
RUN python3 -m venv /opt/venv
|
| 24 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 25 |
|
|
|
|
| 29 |
COPY tutorial.py tutorial.py
|
| 30 |
RUN pip install --break-system-packages -r requirements.txt
|
| 31 |
|
| 32 |
+
# Clone workspace
|
|
|
|
|
|
|
| 33 |
RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
|
| 34 |
cd /mnt/workspace && \
|
| 35 |
git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
|
| 36 |
|
| 37 |
+
# Copy start script
|
| 38 |
COPY start.sh /start.sh
|
| 39 |
|
| 40 |
+
# Set permissions for user 1000
|
| 41 |
+
RUN chown -R appuser:appuser /app /home/appuser && \
|
| 42 |
+
chown -R appuser:appuser /mnt/workspace
|
| 43 |
+
|
| 44 |
+
# Set home directory for XDG base directories
|
| 45 |
+
ENV HOME=/home/appuser
|
| 46 |
+
|
| 47 |
+
EXPOSE 7860
|
| 48 |
+
|
| 49 |
CMD ["/start.sh"]
|