-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
45 lines (35 loc) · 1.17 KB
/
Dockerfile
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
# docker build --target development -t decoderesearch/saedashboard-cuda --file Dockerfile .
# docker run --entrypoint /bin/bash -it decoderesearch/saedashboard-cuda
ARG APP_NAME=sae_dashboard
ARG APP_PATH=/opt/$APP_NAME
ARG PYTHON_VERSION=3.12.2
ARG POETRY_VERSION=1.8.3
FROM pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel AS staging
ARG APP_NAME
ARG APP_PATH
ARG POETRY_VERSION
ENV \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1
ENV \
POETRY_VERSION=$POETRY_VERSION \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1
RUN apt-get update && apt-get install --no-install-recommends -y curl git-lfs vim && rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | python
ENV PATH="$POETRY_HOME/bin:$PATH"
WORKDIR $APP_PATH
COPY ./pyproject.toml ./README.md ./
COPY ./$APP_NAME ./$APP_NAME
FROM staging AS development
ARG APP_NAME
ARG APP_PATH
WORKDIR $APP_PATH
RUN poetry lock
RUN poetry install --no-dev --no-cache
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN git lfs install
ENTRYPOINT ["/bin/bash"]
CMD ["poetry", "shell"]