You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project includes a setup script that will guide you through entering your API keys and generating a `.env` file.
116
116
117
117
Run the script:
118
118
119
-
```bash
120
-
./docker_setup.sh
121
-
```
119
+
```bash
120
+
./docker_setup.sh
121
+
```
122
122
123
123
Follow the instructions provided by the script. It will ask for your OpenAI API key and Telegram Bot API key, validate them, and create a `.env` file with your credentials.
124
124
125
125
### **Step 3: Build the Docker Image**
126
126
127
127
Once your `.env` file has been created, you need to build the Docker image.
128
128
129
-
Run the following command to build the Docker image:
129
+
You can run the featured `docker_deploy.sh` to build the Docker image:
130
+
131
+
```bash
132
+
sudo ./docker_deploy.sh
133
+
```
134
+
135
+
Or, you can build it manually:
130
136
131
-
```bash
132
-
sudo docker build -t telegrambot-openai-api .
133
-
```
137
+
```bash
138
+
sudo docker build -t telegrambot-openai-api .
139
+
```
134
140
135
141
This will build the image locally based on the `Dockerfile` in the repository.
136
142
@@ -140,9 +146,9 @@ After the image is successfully built, you can start the bot in a Docker contain
140
146
141
147
Run the container with the following command:
142
148
143
-
```bash
144
-
sudo docker run --env-file .env -d telegrambot-openai-api
145
-
```
149
+
```bash
150
+
sudo docker run --env-file .env --name telegrambot-openai-api -d telegrambot-openai-api
151
+
```
146
152
147
153
- The `-d` flag runs the container in detached mode (in the background).
148
154
- The `--env-file .env` flag injects your API keys into the container.
0 commit comments