javear commited on
Commit
ceeea2e
·
verified ·
1 Parent(s): 898ec29

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for LangFlow on Hugging Face Spaces
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 \
10
+ LC_ALL=C.UTF-8
11
+
12
+ # Set work directory
13
+ WORKDIR /app
14
+
15
+ # Install system dependencies
16
+ RUN apt-get update \
17
+ && apt-get install -y --no-install-recommends gcc libpq-dev build-essential \
18
+ && apt-get clean \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Install Poetry (Python dependency manager)
22
+ RUN pip install --no-cache-dir poetry
23
+
24
+ # Copy project files
25
+ COPY . /app
26
+
27
+ # Install dependencies
28
+ RUN poetry config virtualenvs.create false \
29
+ && poetry install --no-interaction --no-ansi
30
+
31
+ # Set environment variable for PostgreSQL
32
+ ENV DATABASE_URL=postgres://avnadmin:AVNS_GqgQl5crS6BcPDzp3jC@pg-lentera-budgetcontrol.e.aivencloud.com:24559/defaultdb?sslmode=require
33
+
34
+ # Hugging Face Spaces require the app to listen on port 7860
35
+ EXPOSE 7860
36
+
37
+ # Run LangFlow
38
+ CMD ["poetry", "run", "langflow", "--host", "0.0.0.0", "--port", "7860"]