Bo / Dockerfile
uran69's picture
Create Dockerfile
fd4ca81 verified
Raw History Blame Contribute Delete
1.72 kB
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
# Systempakete installieren
RUN apt-get update && \
apt-get install -y openssh-server sudo git nano curl npm && \
mkdir /var/run/sshd
# Benutzer "pi" erstellen
RUN useradd -m -s /bin/bash pi && \
echo "pi:asdfmnbv" | chpasswd && \
usermod -aG sudo pi
# SSH-Konfiguration anpassen
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# Installationsskript für Node.js, npm und pnpm nach /root/1.sh schreiben
RUN cat <<EOF > /root/1.sh
#!/bin/bash
apt update && apt install -y curl npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="\$HOME/.nvm"
[ -s "\$NVM_DIR/nvm.sh" ] && . "\$NVM_DIR/nvm.sh"
nvm install node
npm install -g pnpm
EOF
RUN chmod +x /root/1.sh
# Installationsskript für Bolt nach /home/pi/1.sh schreiben
RUN cat <<EOF > /home/pi/1.sh
#!/bin/bash
cd /home/pi
git clone https://github.com/stackblitz-labs/bolt.diy.git bolt
cd bolt
pnpm install
pnpm run dev --host 0.0.0.0
EOF
RUN chmod +x /home/pi/1.sh && chown pi:pi /home/pi/1.sh
# Container Startbefehl
CMD ["/usr/sbin/sshd", "-D"]
FROM python:3.9
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]