javear commited on
Commit
e3e4a2b
·
verified ·
1 Parent(s): 0f8c172

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -15
Dockerfile CHANGED
@@ -1,22 +1,25 @@
1
- FROM python:3.10-slim
 
2
 
3
- ENV PYTHONDONTWRITEBYTECODE=1 \
4
- PYTHONUNBUFFERED=1 \
5
- LANG=C.UTF-8 \
6
- LC_ALL=C.UTF-8
7
 
8
- WORKDIR /app
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
- RUN pip install --no-cache-dir poetry
13
-
14
- COPY . /app
15
 
16
- RUN poetry install --no-interaction --no-ansi
 
 
17
 
18
- EXPOSE 7860
 
19
 
20
- ENV DATABASE_URL=postgresql+psycopg2://langflow_user:langflow_password@your-cloud-postgres-url:5432/langflow_db
 
21
 
22
- CMD ["poetry", "run", "langflow_lentera", "--host", "0.0.0.0", "--port", "7860"]
 
 
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"]