Update Dockerfile
Browse files- Dockerfile +3 -10
Dockerfile
CHANGED
|
@@ -3,31 +3,24 @@ FROM python:3.9-slim
|
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
RUN apt-get update && apt-get
|
| 7 |
build-essential \
|
| 8 |
curl \
|
| 9 |
-
software-properties-common \
|
| 10 |
git \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy requirements file and install Python packages
|
| 14 |
COPY --chown=user requirements.txt ./requirements.txt
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
# Copy source code and assign ownership to 'user'
|
| 18 |
COPY --chown=user src/ ./src/
|
| 19 |
|
| 20 |
-
RUN pip3 install -r requirements.txt
|
| 21 |
-
|
| 22 |
-
# Switch to the "user" user
|
| 23 |
USER user
|
| 24 |
|
| 25 |
-
# Set home to the user's home directory
|
| 26 |
ENV HOME=/home/user \
|
| 27 |
-
|
| 28 |
|
| 29 |
EXPOSE 8501
|
| 30 |
|
| 31 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 32 |
|
| 33 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
|
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
| 12 |
COPY --chown=user requirements.txt ./requirements.txt
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
|
|
|
| 15 |
COPY --chown=user src/ ./src/
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
USER user
|
| 18 |
|
|
|
|
| 19 |
ENV HOME=/home/user \
|
| 20 |
+
PATH=/home/user/.local/bin:$PATH
|
| 21 |
|
| 22 |
EXPOSE 8501
|
| 23 |
|
| 24 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 25 |
|
| 26 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|