IliaLarchenko commited on
Commit
83031e2
1 Parent(s): 2d989a9

Added docker

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -0
  2. docker-compose.yml +10 -0
  3. docs/instruction.py +43 -30
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory in the container to /app
5
+ WORKDIR /app
6
+
7
+ # Copy the local directory contents into the container
8
+ COPY . .
9
+
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Expose port 7860 to access the app
14
+ EXPOSE 7860
15
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
16
+
17
+ # Command to run the application
18
+ CMD ["python", "app.py"]
docker-compose.yml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+ services:
3
+ interviewer:
4
+ build: .
5
+ ports:
6
+ - "7860:7860"
7
+ volumes:
8
+ - .:/app
9
+ env_file:
10
+ - .env
docs/instruction.py CHANGED
@@ -30,70 +30,83 @@ Check out the other sections for instructions on how to set up the tool, use the
30
 
31
  """,
32
  "quick_start": """
33
- # Setting Up Locally
34
 
35
- Follow these steps to set up the AI Tech Interviewer Training tool on your local machine:
36
 
37
- ## Prerequisites
38
 
39
- Before starting the setup, ensure you have Python installed on your system. You can download Python from [python.org](https://www.python.org/downloads/).
40
-
41
- ## Clone the Repository
42
 
43
  First, clone the project repository to your local machine using the following command in your terminal:
44
 
45
  ```bash
46
  git clone https://huggingface.co/spaces/IliaLarchenko/interviewer
 
47
  ```
48
 
49
- ## Create a Virtual Environment
50
 
51
- Create a virtual environment to manage the dependencies separately from your system-wide Python installations:
52
 
53
  ```bash
54
- cd interviewer
55
- python -m venv venv
56
- source venv/bin/activate
57
  ```
58
 
59
- ## Install Dependencies
60
 
61
- Install the necessary Python packages within the virtual environment:
62
 
63
- ```bash
64
- pip install -r requirements.txt
65
- ```
66
 
67
- ## Set Up Environment Variables
68
 
69
- The application uses environment variables defined in a `.env` file for configuration. Create this file by copying the provided example and update it with your own configurations:
70
 
71
  ```bash
72
- cp .env.openai.example .env
73
- nano .env # or use any other text editor to edit the .env file
74
  ```
75
 
76
- Be sure to replace `sk-YOUR_OPENAI_API_KEY` with your actual OpenAI API key, which you can obtain from [OpenAI Platform](https://platform.openai.com/api-keys).
 
 
77
 
78
- ### Additional Configuration for HuggingFace Spaces
79
 
80
- If you choose to copy the demo space on HuggingFace instead of using a local `.env` file, you will need to set up all the environment variables in the space setup.
81
 
82
- You will also need the `.env` file to use any non-OpenAI models, as described below. You can also refer to one of the example `.env` files provided in the repository for guidance.
83
 
84
- ## Running the Application
85
 
86
- With the environment set up, you are now ready to run the application. Execute the following command in your terminal:
87
 
88
  ```bash
89
- python app.py
 
 
 
 
 
 
 
 
 
90
  ```
91
 
92
- This will start the server, and the application should be accessible locally. By default, it usually runs at `http://localhost:7860` but check your terminal output to confirm the exact URL.
 
 
93
 
94
- ## Next Steps
 
 
95
 
96
- Now that your application is running, you can proceed to the [Interview Interface Overview](#interview-interface-overview) section to learn how to interact with the application.
97
  """,
98
  "interface": """
99
  # Interview Interface Overview
 
30
 
31
  """,
32
  "quick_start": """
33
+ # Running the AI Tech Interviewer Simulator
34
 
35
+ This guide provides detailed instructions for setting up and running the AI Tech Interviewer Simulator either using Docker (recommended for simplicity) or running it locally.
36
 
37
+ ## Initial Setup
38
 
39
+ ### Clone the Repository
 
 
40
 
41
  First, clone the project repository to your local machine using the following command in your terminal:
42
 
43
  ```bash
44
  git clone https://huggingface.co/spaces/IliaLarchenko/interviewer
45
+ cd interviewer
46
  ```
47
 
48
+ ### Configure the Environment
49
 
50
+ Create a `.env` file from the provided example and edit it to include your OpenAI API key:
51
 
52
  ```bash
53
+ cp .env.openai.example .env
54
+ nano .env # You can use any other text editor
 
55
  ```
56
 
57
+ Replace `OPENAI_API_KEY` in the `.env` file with your actual OpenAI API key.
58
 
59
+ ## Option 1: Running with Docker
60
 
61
+ ### Prerequisites
62
+
63
+ - Ensure **Docker** and **Docker Compose** are installed on your system. Download and install them from Docker's [official site](https://www.docker.com/get-started).
64
 
65
+ ### Build and Run the Docker Container
66
 
67
+ Build and start the Docker container using the following commands:
68
 
69
  ```bash
70
+ docker-compose build
71
+ docker-compose up
72
  ```
73
 
74
+ ### Access the Application
75
+
76
+ The application will be accessible at `http://localhost:7860`. Open this URL in your browser to start using the AI Tech Interviewer Simulator.
77
 
78
+ ## Option 2: Running Locally
79
 
80
+ ### Prerequisites
81
 
82
+ - Ensure you have **Python** installed on your system. Download and install it from [python.org](https://www.python.org).
83
 
84
+ ### Set Up the Python Environment
85
 
86
+ Create a virtual environment to isolate the package dependencies:
87
 
88
  ```bash
89
+ python -m venv venv
90
+ source venv/bin/activate
91
+ ```
92
+
93
+ ### Install Dependencies
94
+
95
+ Install the required Python packages within the virtual environment:
96
+
97
+ ```bash
98
+ pip install -r requirements.txt
99
  ```
100
 
101
+ ### Running the Application
102
+
103
+ Start the server by executing:
104
 
105
+ ```bash
106
+ python app.py
107
+ ```
108
 
109
+ The application should now be accessible locally, typically at `http://localhost:7860`. Check your terminal output to confirm the URL.
110
  """,
111
  "interface": """
112
  # Interview Interface Overview