competition-vd/dockerfile

44 lines
1.0 KiB
Plaintext
Executable File

FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
vim \
tmux \
htop \
graphviz \
libgraphviz-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements_and_setup/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install jupyterlab pygraphviz
COPY . /app
ENV PYTHONPATH=/app
ENV CUDA_VISIBLE_DEVICES=all
RUN python -c "from transformers import AutoTokenizer, AutoModel; AutoTokenizer.from_pretrained('microsoft/codebert-base'); AutoModel.from_pretrained('microsoft/codebert-base')"
RUN useradd -m appuser
RUN chown -R appuser:appuser /app
USER appuser
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
EXPOSE 8080 8888
ENTRYPOINT ["python", "code/train_stuff.py"]
CMD ["--config", "config_and_scripts/main_config.yaml"]