Spaces:
Paused
Paused
| FROM python:3.10 | |
| WORKDIR /home/ | |
| COPY ./requirements.txt /home/requirements.txt | |
| RUN apt update && \ | |
| apt install -y --no-install-recommends \ | |
| curl \ | |
| git \ | |
| git-lfs \ | |
| libatomic1 \ | |
| locales \ | |
| man \ | |
| nano \ | |
| net-tools \ | |
| openssh-client \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| sudo \ | |
| vim \ | |
| wget \ | |
| zsh \ | |
| zip \ | |
| unzip \ | |
| ffmpeg \ | |
| imagemagick \ | |
| && git lfs install \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ENV USERNAME=user \ | |
| USER_UID=1000 \ | |
| USER_GID=1000 \ | |
| LANG=C.UTF-8 \ | |
| LC_ALL=C.UTF-8 \ | |
| NVIDIA_VISIBLE_DEVICES=all \ | |
| NVIDIA_DRIVER_CAPABILITIES=all \ | |
| EDITOR=code \ | |
| VISUAL=code \ | |
| GIT_EDITOR="code --wait" \ | |
| OPENVSCODE_SERVER_ROOT=/home/.vscode \ | |
| OPENVSCODE=/home/.vscode/bin/openvscode-server | |
| ENV DEBIAN_FRONTEND=dialog | |
| RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| RUN sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| RUN wget https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/8.0/multiverse/binary-amd64/mongodb-org-server_8.0.0_amd64.deb | |
| RUN sudo apt install ./mongodb-org-server_8.0.0_amd64.deb | |
| RUN pip install --no-cache-dir --upgrade -r /home/requirements.txt | |
| COPY . . | |
| WORKDIR /home/user/ | |
| # Creating the user and usergroup | |
| RUN groupadd --gid ${USER_GID} ${USERNAME} \ | |
| && useradd --uid ${USER_UID} --gid ${USERNAME} -m -s /bin/bash ${USERNAME} \ | |
| && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ | |
| && chmod 0440 /etc/sudoers.d/${USERNAME} | |
| RUN chmod g+rw /home && \ | |
| chown -R ${USERNAME}:${USERNAME} /home/${USERNAME} | |
| RUN mkdir -p /db && chown -R ${USERNAME}:${USERNAME} /db | |
| USER $USERNAME | |
| COPY . . | |
| # Install oh-my-zsh & Init# Start MongoDB and Flask | |
| CMD ["sh", "-c", "Malloc=system mongod --dbpath /db --logpath mongod.log --fork && flask run --host=0.0.0.0 --port=7860"] |