Castri1
commited on
Commit
·
c78e294
1
Parent(s):
f2b9292
Refactor Dockerfile to add host binding for 0.0.0.0
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a Python 3.12 base image
|
| 2 |
+
FROM python:3.12
|
| 3 |
+
|
| 4 |
+
# Create a user and set environment variables
|
| 5 |
+
RUN useradd -m -u 1000 user && \
|
| 6 |
+
mkdir -p /home/user/app/files && \
|
| 7 |
+
chown -R user:user /home/user/app && \
|
| 8 |
+
apt-get update && \
|
| 9 |
+
apt-get install -y tesseract-ocr poppler-utils && \
|
| 10 |
+
rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
USER user
|
| 13 |
+
ENV HOME=/home/user \
|
| 14 |
+
PATH=/home/user/.local/bin:$PATH
|
| 15 |
+
|
| 16 |
+
# Set the working directory
|
| 17 |
+
WORKDIR $HOME/app
|
| 18 |
+
|
| 19 |
+
# Copy your application code and requirements.txt
|
| 20 |
+
COPY --chown=user . .
|
| 21 |
+
COPY --chown=user requirements.txt $HOME/app/requirements.txt
|
| 22 |
+
|
| 23 |
+
# Install Python dependencies
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# Specify the command to run your application
|
| 27 |
+
CMD ["chainlit", "run", "app.py", "--port", "7860", "--host", "0.0.0.0"]
|