Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
tesseract-ocr \
|
| 6 |
libgl1-mesa-glx \
|
|
@@ -12,7 +12,7 @@ RUN useradd -m appuser
|
|
| 12 |
USER appuser
|
| 13 |
WORKDIR /home/appuser/app
|
| 14 |
|
| 15 |
-
# Set environment
|
| 16 |
ENV HOME=/home/appuser
|
| 17 |
ENV STREAMLIT_HOME=/home/appuser/.streamlit
|
| 18 |
RUN mkdir -p $STREAMLIT_HOME
|
|
@@ -26,12 +26,15 @@ enableCORS = false\n\
|
|
| 26 |
enableXsrfProtection = false\n\
|
| 27 |
\n" > $STREAMLIT_HOME/config.toml
|
| 28 |
|
| 29 |
-
#
|
| 30 |
COPY requirements.txt .
|
| 31 |
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
-
# Copy
|
| 34 |
COPY . .
|
| 35 |
|
|
|
|
| 36 |
EXPOSE 7860
|
| 37 |
-
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
tesseract-ocr \
|
| 6 |
libgl1-mesa-glx \
|
|
|
|
| 12 |
USER appuser
|
| 13 |
WORKDIR /home/appuser/app
|
| 14 |
|
| 15 |
+
# Set environment
|
| 16 |
ENV HOME=/home/appuser
|
| 17 |
ENV STREAMLIT_HOME=/home/appuser/.streamlit
|
| 18 |
RUN mkdir -p $STREAMLIT_HOME
|
|
|
|
| 26 |
enableXsrfProtection = false\n\
|
| 27 |
\n" > $STREAMLIT_HOME/config.toml
|
| 28 |
|
| 29 |
+
# Copy requirements and install
|
| 30 |
COPY requirements.txt .
|
| 31 |
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
+
# Copy all code
|
| 34 |
COPY . .
|
| 35 |
|
| 36 |
+
# Expose port
|
| 37 |
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Run Streamlit
|
| 40 |
+
CMD ["python", "-m", "streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|