Chris4K commited on
Commit
af03e48
·
verified ·
1 Parent(s): 923f1a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -32
Dockerfile CHANGED
@@ -1,37 +1,22 @@
1
- # Start from a base Python image
2
- FROM python:3.11-slim
3
 
4
- # Install system dependencies
5
- RUN apt-get update && \
6
- apt-get install -y --no-install-recommends \
7
- build-essential curl wget postgresql postgresql-contrib nodejs npm supervisor && \
8
- apt-get clean && \
9
- rm -rf /var/lib/apt/lists/*
 
10
 
11
- # Set up a working directory
12
- WORKDIR /app
 
13
 
14
- # Install Langfuse dependencies
15
- COPY ./requirements.txt requirements.txt
16
- RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Install Node.js dependencies for Langfuse
19
- RUN npm install -g npm@latest
20
- COPY . .
21
- RUN npm install
22
 
23
- # Set up environment variables (for in-memory Postgres)
24
- ENV POSTGRES_USER=pgstac \
25
- POSTGRES_PASSWORD=pgstac \
26
- POSTGRES_DB=postgis \
27
- POSTGRES_HOST=127.0.0.1 \
28
- POSTGRES_PORT=5432
29
-
30
- # Set up a supervisor to run both Postgres and Langfuse
31
- COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
32
-
33
- # Expose the default Langfuse port
34
- EXPOSE 3000
35
-
36
- # Start Supervisor
37
- CMD ["/usr/bin/supervisord"]
 
1
+ # Use the official Langfuse image
2
+ FROM langfuse/langfuse:latest
3
 
4
+ # Set environment variables for a minimal, ephemeral setup
5
+ ENV DATABASE_URL=postgresql://postgres:postgres@localhost:5432/langfuse
6
+ ENV NEXTAUTH_SECRET=your_random_secret_here
7
+ ENV SALT=your_random_salt_here
8
+ ENV NEXTAUTH_URL=https://your-space-name.hf.space
9
+ ENV HOSTNAME=0.0.0.0
10
+ ENV PORT=7860
11
 
12
+ # Use an in-memory SQLite database for HF Spaces
13
+ # Note: This is not recommended for production, only for demonstration
14
+ ENV DATABASE_TYPE=sqlite
15
 
16
+ # Disable signup if needed
17
+ ENV AUTH_DISABLE_SIGNUP=true
 
18
 
19
+ # Expose the default Hugging Face Spaces port
20
+ EXPOSE 7860
 
 
21
 
22
+ # The default CMD from the Langfuse image should work