Spaces:
Paused
Paused
| FROM python:3.10 | |
| WORKDIR /code | |
| # Copy requirements | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Copy binary parts | |
| COPY cf_part_* /code/ | |
| # Reassemble and permissions | |
| RUN cat /code/cf_part_* > /code/cloudflared && \ | |
| chmod +x /code/cloudflared && \ | |
| rm /code/cf_part_* | |
| # Install OpenSSH Server & Gen Keys | |
| RUN apt-get update && apt-get install -y openssh-server && \ | |
| mkdir -p /run/sshd && \ | |
| chmod 777 /run/sshd && \ | |
| echo 'root:password' | chpasswd && \ | |
| ssh-keygen -A && \ | |
| sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ | |
| sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config | |
| # Exposure check | |
| RUN echo "User: $(whoami)" > /code/user_check.txt | |
| COPY . /code | |
| CMD ["python", "app.py"] | |