mkalia commited on
Commit
8a835a5
1 Parent(s): f696261

initial commit

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -0
Dockerfile CHANGED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.12.3
3
+
4
+ # Set up a new user named "user" with user ID 1000, Essential
5
+ RUN useradd -m -u 1000 user
6
+
7
+ # Switch to the "user" user
8
+ USER user
9
+
10
+ # Set home to the user's home directory
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH
13
+
14
+ # Set the working directory to the user's home directory
15
+ WORKDIR $HOME/app
16
+
17
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
18
+ RUN pip install --no-cache-dir --upgrade pip
19
+
20
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
21
+ COPY --chown=user . $HOME/app
22
+
23
+ # Install any needed packages specified in requirements.txt
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Download the weights for streamlit app for inference from github
27
+ RUN wget https://github.com/meghakalia/depthEstimationColonoscopy/releases/download/0.0.1/depth.pth
28
+ RUN wget https://github.com/meghakalia/depthEstimationColonoscopy/releases/download/0.0.1/encoder.pth
29
+ RUN wget https://github.com/meghakalia/depthEstimationColonoscopy/releases/download/0.0.1/pose.pth
30
+ RUN wget https://github.com/meghakalia/depthEstimationColonoscopy/releases/download/0.0.1/pose_encoder.pth
31
+
32
+ # Create the .streamlit directory
33
+ RUN mkdir -p .streamlit
34
+
35
+ # Create the config.toml file and set the maxMessageSize, to display large data in the browser
36
+ # RUN echo "\
37
+ # [server]\n\
38
+ # maxMessageSize = 2000\n\
39
+ # " > .streamlit/config.toml
40
+
41
+ # Important: Make port 8501 available to the world outside this container
42
+ EXPOSE 8501
43
+
44
+ # Run filter_data_app.py when the container launches
45
+ CMD streamlit run depth_app.py