Skip to content

Commit 00a9d1f

Browse files
Merge pull request #24 from Nick1200000/enhancement/add-dockerfile
Added the Dockerfile for the GraphGen
2 parents 3836ad4 + ceab759 commit 00a9d1f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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"]

0 commit comments

Comments
 (0)