javear commited on
Commit
7e72ff2
·
verified ·
1 Parent(s): f543437

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -1,9 +1,7 @@
1
- # Dockerfile for LangFlow with PostgreSQL
2
-
3
  # Use an official Python runtime as a parent image
4
  FROM python:3.10-slim
5
 
6
- # Set environment variables to minimize Docker image size
7
  ENV PYTHONDONTWRITEBYTECODE=1 \
8
  PYTHONUNBUFFERED=1 \
9
  LANG=C.UTF-8 \
@@ -18,22 +16,21 @@ RUN apt-get update \
18
  && apt-get clean \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
- # Upgrade pip and install Poetry
22
- RUN python -m pip install --upgrade pip \
23
- && pip install --no-cache-dir poetry
24
 
25
  # Copy project files
26
  COPY . /app
27
 
28
- # Install dependencies using Poetry
29
  RUN poetry config virtualenvs.create false \
30
  && poetry install --no-interaction --no-ansi
31
 
32
- # Expose application port
33
  EXPOSE 7860
34
 
35
  # Set environment variable for PostgreSQL
36
  ENV DATABASE_URL=postgresql+psycopg2://langflow_user:langflow_password@your-cloud-postgres-url:5432/langflow_db
37
 
38
- # Set the entrypoint command
39
  CMD ["poetry", "run", "langflow", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.10-slim
3
 
4
+ # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1 \
7
  LANG=C.UTF-8 \
 
16
  && apt-get clean \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Install Poetry (if used) or pip
20
+ RUN pip install --no-cache-dir poetry
 
21
 
22
  # Copy project files
23
  COPY . /app
24
 
25
+ # Install dependencies (use Poetry or pip based on your setup)
26
  RUN poetry config virtualenvs.create false \
27
  && poetry install --no-interaction --no-ansi
28
 
29
+ # Expose application port (Hugging Face Spaces expects port 7860)
30
  EXPOSE 7860
31
 
32
  # Set environment variable for PostgreSQL
33
  ENV DATABASE_URL=postgresql+psycopg2://langflow_user:langflow_password@your-cloud-postgres-url:5432/langflow_db
34
 
35
+ # Run LangFlow application
36
  CMD ["poetry", "run", "langflow", "--host", "0.0.0.0", "--port", "7860"]