Skip to content
Snippets Groups Projects
Dockerfile 961 B
Newer Older
Xuefeng Ding's avatar
Xuefeng Ding committed
# Use AlmaLinux 9 base image
FROM almalinux:9

RUN useradd -m vscode

RUN dnf --best --assumeyes update \
    && dnf -y install \
    python3.11 \
    python3.11-pip \
    gcc \
    make \
    cmake \
    git \
    zsh \
    which \
    util-linux-user \
    && dnf clean all \
    && chsh -s /bin/zsh vscode


WORKDIR /workspaces
USER vscode

RUN python3.11 -m venv /workspaces/.venv

COPY requirements.txt /workspaces/requirements.txt
COPY requirements-dev.txt /workspaces/requirements-dev.txt
COPY .devcontainer/install_zsh.sh /workspaces/install_zsh.sh

RUN /workspaces/install_zsh.sh

RUN echo 'source /workspaces/.venv/bin/activate' >> ~/.zshrc \
    && source /workspaces/.venv/bin/activate \
    && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
    && pip install --upgrade pip \
    && pip install -r requirements-dev.txt

RUN rm -rf /workspaces/requirements.txt /workspaces/requirements-dev.txt /workspaces/install_zsh.sh