LONGYKING
commited on
Commit
·
0e14b64
1
Parent(s):
1f9439e
deployment fixes
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -3,28 +3,30 @@ FROM python:3.11-slim
|
|
| 3 |
|
| 4 |
# Create a user and set permissions
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
-
USER user
|
| 7 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
|
| 9 |
# Set the working directory in the container
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
# Install PostgreSQL client libraries and development headers
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
libpq-dev \
|
| 15 |
gcc \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
# Copy the rest of the application code into the container
|
| 19 |
COPY --chown=user . .
|
| 20 |
|
| 21 |
# Install any needed packages specified in requirements.txt
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
#EXPOSE 8000
|
| 26 |
EXPOSE 8080
|
| 27 |
|
| 28 |
# Run chainlit when the container launches
|
| 29 |
-
CMD ["python", "-m", "chainlit", "run", "chatxbt-assistant.py", "
|
| 30 |
-
|
|
|
|
| 3 |
|
| 4 |
# Create a user and set permissions
|
| 5 |
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Set the working directory in the container
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
# Install PostgreSQL client libraries and development headers
|
| 11 |
+
# Note: You may need to switch back to root temporarily for this step
|
| 12 |
+
USER root
|
| 13 |
+
RUN apt-get update && \
|
| 14 |
+
apt-get install -y --no-install-recommends \
|
| 15 |
libpq-dev \
|
| 16 |
gcc \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
+
# Switch back to the non-root user
|
| 20 |
+
USER user
|
| 21 |
+
|
| 22 |
# Copy the rest of the application code into the container
|
| 23 |
COPY --chown=user . .
|
| 24 |
|
| 25 |
# Install any needed packages specified in requirements.txt
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Expose port 8080 to the world outside this container
|
|
|
|
| 29 |
EXPOSE 8080
|
| 30 |
|
| 31 |
# Run chainlit when the container launches
|
| 32 |
+
CMD ["python", "-m", "chainlit", "run", "chatxbt-assistant.py", "--host", "0.0.0.0", "--port", "8080"]
|
|
|