PabloVD commited on
Commit
0163307
·
1 Parent(s): ee1e323

Setup dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -6
Dockerfile CHANGED
@@ -1,7 +1,10 @@
1
- FROM python:3.9-slim
 
2
 
3
- WORKDIR /app
 
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
@@ -9,13 +12,31 @@ RUN apt-get update && apt-get install -y \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- COPY requirements.txt ./
13
- COPY src/ ./src/
14
 
15
- RUN pip3 install -r requirements.txt
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  EXPOSE 8501
18
 
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
21
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ # Use an official Python image as base
2
+ FROM python:3.13-slim
3
 
4
+ # Set environment variables to avoid interactive prompts during package installs
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  curl \
 
12
  git \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Set up a new user named "user" with user ID 1000
16
+ RUN useradd -m -u 1000 user
17
 
18
+ # Switch to the "user" user
19
+ USER user
20
 
21
+ # Set home to the user's home directory
22
+ ENV HOME=/home/user \
23
+ PATH=/home/user/.local/bin:$PATH
24
+
25
+ # Install the project into `/app`
26
+ WORKDIR $HOME/app
27
+
28
+ # Then, add the rest of the project source code and install it
29
+ # Installing separately from its dependencies allows optimal layer caching
30
+ # Copy all the app code to the docker
31
+ COPY --chown=user . $HOME/app
32
+
33
+ # Install Astropilot
34
+ RUN pip install cmbagent@https://github.com/CMBAgents/cmbagent.git@pablo/gui_keys
35
+
36
+ # This informs Docker that the container will listen on port 5000 at runtime.
37
  EXPOSE 8501
38
 
39
+ # Command to run the app
40
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
41
 
42
+ CMD ["cmbagent", "run", "--server.port=8501", "--server.address=0.0.0.0"]