Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +18 -15
Dockerfile
CHANGED
@@ -1,22 +1,25 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
LC_ALL=C.UTF-8
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
RUN apt-get update && apt-get install -y --no-install-recommends gcc libpq-dev build-essential && apt-get clean && rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
COPY . /app
|
15 |
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
-
|
|
|
21 |
|
22 |
-
|
|
|
|
1 |
+
# Use the official Python image as a base
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
+
# Set environment variables for LangFlow
|
5 |
+
ENV LANGFLOW_DATABASE_URL=postgres://avnadmin:AVNS_GqgQl5crS6BcPDzp3jC@pg-lentera-budgetcontrol.e.aivencloud.com:24559/defaultdb?sslmode=require
|
6 |
+
ENV LANGFLOW_CONFIG_DIR=/var/lib/langflow
|
|
|
7 |
|
8 |
+
# Create a user to run the application
|
9 |
+
RUN useradd -m -u 1000 user
|
|
|
10 |
|
11 |
+
# Set the working directory
|
12 |
+
WORKDIR /app
|
|
|
13 |
|
14 |
+
# Copy requirements file and install dependencies
|
15 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
16 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
|
18 |
+
# Copy the rest of the application code (if any)
|
19 |
+
COPY --chown=user . /app
|
20 |
|
21 |
+
# Switch to the non-root user
|
22 |
+
USER user
|
23 |
|
24 |
+
# Command to run LangFlow directly
|
25 |
+
CMD ["langflow", "run"]
|