-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1006 Bytes
/
Copy pathDockerfile
File metadata and controls
49 lines (36 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.12-slim
WORKDIR /workspace
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/workspace/src \
PIP_NO_CACHE_DIR=1 \
POETRY_VIRTUALENVS_CREATE=false
ARG TORCH_VARIANT=cpu
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade \
pip \
setuptools \
wheel \
poetry \
pydevd-pycharm
COPY pyproject.toml poetry.lock* /workspace/
RUN poetry install --with dev --no-root
RUN if [ "$TORCH_VARIANT" = "gpu" ]; then \
pip install torch torchvision \
--index-url https://download.pytorch.org/whl/cu121 ; \
else \
pip install torch torchvision \
--index-url https://download.pytorch.org/whl/cpu ; \
fi
RUN mkdir -p \
/workspace/data \
/workspace/apps \
/workspace/notebooks
COPY src /workspace/src
VOLUME ["/workspace/data"]
EXPOSE 8888 8000 5000 5678
CMD ["bash"]