File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # Use a slim version of Python 3.10 as the base image
2+ FROM python:3.10-slim
3+
4+ # Set environment variables to prevent Python from writing .pyc files
5+ # and to ensure output is logged directly
6+ ENV PYTHONDONTWRITEBYTECODE=1
7+ ENV PYTHONUNBUFFERED=1
8+
9+ # Set the working directory inside the container
10+ WORKDIR /app
11+
12+ # Install system dependencies required for building Python packages
13+ RUN apt-get update && \
14+ apt-get install -y --no-install-recommends \
15+ git \
16+ build-essential \
17+ && apt-get clean && \
18+ rm -rf /var/lib/apt/lists/*
19+
20+ # Create a non-root user and switch to that user
21+ RUN useradd -m appuser
22+
23+ # Copy requirements file and install Python dependencies
24+ COPY requirements.txt .
25+ RUN pip install --upgrade pip && \
26+ pip install --no-cache-dir -r requirements.txt
27+
28+ # Copy the rest of the application code into the container
29+ COPY . .
30+
31+ # Create necessary directories
32+ RUN mkdir -p cache/data/graphgen cache/logs
33+
34+ # Environment variables for application config
35+ ENV SYNTHESIZER_MODEL=""
36+ ENV SYNTHESIZER_BASE_URL=""
37+ ENV SYNTHESIZER_API_KEY=""
38+ ENV TRAINEE_MODEL=""
39+ ENV TRAINEE_BASE_URL=""
40+ ENV TRAINEE_API_KEY=""
41+
42+ # Expose the port the app will run on
43+ EXPOSE 7860
44+
45+ # Switch to the non-root user
46+ USER appuser
47+
48+ # Command to run the application
49+ CMD ["python" , "webui/app.py" ]
You can’t perform that action at this time.
0 commit comments