MarkWrobel commited on
Commit
a0894b8
·
verified ·
1 Parent(s): c66e74e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +51 -59
Dockerfile CHANGED
@@ -1,59 +1,51 @@
1
- # ===== Base image =====
2
- # Use GPU build only if you enabled a GPU in Space settings.
3
- #FROM tensorflow/tensorflow:2.9.1-gpu
4
- # For CPU-only Spaces, use:
5
- FROM tensorflow/tensorflow:2.9.1
6
-
7
- ENV PYTHONDONTWRITEBYTECODE=1 \
8
- PYTHONUNBUFFERED=1 \
9
- PIP_NO_CACHE_DIR=1 \
10
- PYTHONPATH=/app:${PYTHONPATH} \
11
- MPLCONFIGDIR=/app/.matplotlib
12
-
13
- # ----- System deps -----
14
- ARG DEBIAN_FRONTEND=noninteractive
15
- RUN apt-get update && apt-get install -y --no-install-recommends \
16
- libopenexr-dev ffmpeg sudo build-essential git pkg-config && \
17
- rm -rf /var/lib/apt/lists/*
18
-
19
- # ----- Python tooling -----
20
- RUN python -m pip install --upgrade pip "setuptools<70" wheel
21
-
22
- # ----- Pins compatible with TF 2.9.x -----
23
- RUN pip install \
24
- "protobuf==3.19.6" \
25
- "tensorflow-addons==0.17.1" \
26
- "numpy==1.22.4" "scipy==1.8.1" "pandas==1.3.5"
27
-
28
- # ----- Your other deps -----
29
- RUN pip install \
30
- tqdm h5py scikit-image==0.19.3 jupyter typing_extensions \
31
- matplotlib opencv-python gdown==2.3.1 pydicom scikit-learn==1.1.3 \
32
- tabulate pingouin streamlit==1.22.0 openpyxl ffmpeg-python gputil
33
-
34
- # If you actually need it, uncomment and pin to a version that exists on PyPI:
35
- # RUN pip install "tensorflow-mri<0.23" # e.g., ==0.22.0
36
-
37
- # ----- App code -----
38
- WORKDIR /app
39
- COPY . /app
40
-
41
- # Writable config/cache dirs
42
- RUN mkdir -p /app/.matplotlib /app/.streamlit && chmod -R 777 /app/.matplotlib /app/.streamlit
43
-
44
- # Streamlit config (no heredoc; use printf to avoid quoting problems)
45
- RUN printf "%s\n" \
46
- "[server]" \
47
- "headless = true" \
48
- "enableCORS = false" \
49
- "enableXsrfProtection = false" \
50
- 'address = "0.0.0.0"' \
51
- "[client]" \
52
- 'toolbarMode = "minimal"' \
53
- "[browser]" \
54
- "gatherUsageStats = false" \
55
- > /app/.streamlit/config.toml
56
-
57
- # ----- Entrypoint -----
58
- EXPOSE 7860
59
- CMD ["bash","-lc","python -m streamlit run app.py --server.port ${PORT:-7860}"]
 
1
+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3/.devcontainer/base.Dockerfile
2
+
3
+ # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4
+ FROM tensorflow/tensorflow:2.9.1-gpu
5
+ RUN apt-get install libopenexr-dev -y
6
+ RUN pip install tensorflow-mri
7
+ RUN pip install tqdm
8
+ RUN pip install h5py
9
+ RUN pip install tensorflow-addons
10
+ # RUN pip install sklearn
11
+ RUN pip install scikit-image
12
+ RUN pip install jupyter
13
+ RUN pip install typing_extensions --upgrade
14
+ #RUN pip install neptune
15
+ #RUN pip install neptune-tensorflow-keras
16
+ RUN pip install utils
17
+ RUN pip install matplotlib
18
+ RUN pip install --upgrade pip
19
+ #RUN pip install -U torch-tb-profiler
20
+ RUN pip install opencv-python
21
+ #RUN pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html
22
+ RUN pip install gdown==2.3.1
23
+ RUN pip install pydicom
24
+ RUN pip install scikit-learn
25
+ RUN pip install tabulate
26
+ RUN pip install pingouin
27
+ RUN pip install streamlit
28
+ RUN pip install openpyxl
29
+ RUN pip install "protobuf<=3.20.3"
30
+
31
+
32
+ # Create non-root user.
33
+ ARG USERNAME=vscode
34
+ ARG USER_UID=1003
35
+ ARG USER_GID=$USER_UID
36
+
37
+ RUN groupadd --gid $USER_GID $USERNAME && \
38
+ useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
39
+ # Add user to sudoers.
40
+ apt-get update && \
41
+ apt-get install -y sudo && \
42
+ echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
43
+ chmod 0440 /etc/sudoers.d/$USERNAME && \
44
+ # Change default shell to bash.
45
+ usermod --shell /bin/bash $USERNAME
46
+
47
+ RUN apt-get update && \
48
+ apt-get install -y ffmpeg
49
+
50
+ RUN pip install ffmpeg-python
51
+ RUN pip install gputil