Chris4K commited on
Commit
1886f0e
·
verified ·
1 Parent(s): 80b3b60

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -18
Dockerfile CHANGED
@@ -1,27 +1,37 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
  # Install system dependencies
5
- RUN apt-get update && apt-get install -y \
6
- docker.io \
7
- && rm -rf /var/lib/apt/lists/*
 
 
8
 
9
- # Set the working directory in the container
10
  WORKDIR /app
11
 
12
- # Copy the current directory contents into the container at /app
13
- COPY . /app
 
14
 
15
- # Install any needed packages specified in requirements.txt
16
- RUN pip install --no-cache-dir \
17
- docker \
18
- requests
19
 
20
- # Make port 3000 available to the world outside this container
21
- EXPOSE 3000
 
 
 
 
 
 
 
22
 
23
- # Define environment variable to ensure Python outputs are sent to terminal
24
- ENV PYTHONUNBUFFERED=1
25
 
26
- # Run app.py when the container launches
27
- CMD ["python", "app.py"]
 
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"]