-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (42 loc) · 1.73 KB
/
Dockerfile
File metadata and controls
56 lines (42 loc) · 1.73 KB
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
50
51
52
53
54
55
56
# Stage 1: Base environment build
FROM ubuntu:22.04 as builder
# Disable interactive prompts and configure time zone
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Etc/UTC
# Install apt-get dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates wget git openssh-client && \
rm -rf /var/lib/apt/lists/*
# Install Miniconda
ARG MINICONDA_VERSION=py310_25.1.1-2
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh
# Set conda environment
ENV PATH=/opt/conda/bin:$PATH
# Stage 2: App deployment
FROM ubuntu:22.04
# Copy necessary content from the stage 1 (builder)
COPY --from=builder /opt/conda /opt/conda
# Set environment variables
ENV PATH=/opt/conda/bin:$PATH \
LANG=C.UTF-8 \
PYTHONUNBUFFERED=1
# Git clone the repository
RUN git clone --depth 1 https://github.com/chairc/Integrated-Design-Diffusion-Model.git /app
# Set working directory
WORKDIR /app
# Install (conda + pip)
# If pip is not available, use conda
RUN conda install -y pytorch=1.13.0 torchvision=0.14.0 torchaudio=0.13.0 pytorch-cuda=11.8 -c pytorch -c nvidia && \
conda clean -ya
# If conda is not available, use pip
# RUN pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html
RUN cd /app/Integrated-Design-Diffusion-Model && \
pip install -r requirements.txt && \
pip cache purge
# Verify installation
RUN python -c "import torch; print(f'PyTorch version: {torch.__version__}')" && \
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
# Set the default startup command
CMD ["/bin/bash"]