Spaces:
Build error
Build error
Update Dockerfile
Browse files- 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
|
| 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 |
-
#
|
| 22 |
-
RUN
|
| 23 |
-
&& pip install --no-cache-dir poetry
|
| 24 |
|
| 25 |
# Copy project files
|
| 26 |
COPY . /app
|
| 27 |
|
| 28 |
-
# Install dependencies
|
| 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 |
-
#
|
| 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"]
|