Skip to content

Commit 2ec3bf4

Browse files
committed
docs: update ai-blog setup instructions and improve Terraform configuration explanation
1 parent 38a4a22 commit 2ec3bf4

File tree

1 file changed

+4
-2
lines changed
  • adminforth/documentation/blog/2024-10-01-ai-blog

1 file changed

+4
-2
lines changed

adminforth/documentation/blog/2024-10-01-ai-blog/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Add modules:
4747

4848
```bash
4949
cd ai-blog
50-
npm i @adminforth/upload @adminforth/rich-editor @adminforth/text-complete
50+
npm i @adminforth/upload @adminforth/rich-editor @adminforth/text-complete @adminforth/chat-gpt slugify http-proxy
5151
```
5252

5353

@@ -578,6 +578,8 @@ export default {
578578
openAiApiKey: process.env.OPENAI_API_KEY as string,
579579
model: 'gpt-image-1',
580580
}),
581+
fieldsForContext: ['title'],
582+
outputSize: '1536x1024'
581583
},
582584
}),
583585
new RichEditorPlugin({
@@ -1278,7 +1280,7 @@ terraform apply -auto-approve
12781280
12791281
> ☝️ To check logs run `ssh -i ~/.ssh/id_rsa ec2-user@$(terraform output instance_public_ip)`, then `sudo docker logs -n100 -f aiblog`
12801282
1281-
Terraform config will build Docker image locally and then copy it to EC2 instance. This approach allows to save build resources (CPU/RAM) on EC2 instance, however increases network traffic (image might be around 200MB). If you want to build image on EC2 instance, you can adjust config slightly: remove `null_resource.build_image` and change `null_resource.remote_commands` to build image on EC2 instance, however micro instance most likely will not be able to build and keep app running at the same time, so you will need to increase instance type or terminate app while building image (which introduces downtime so not recommended as well).
1283+
Terraform config will build the Docker image locally and then copy it to the EC2 instance. This approach saves build resources (CPU/RAM) on the EC2 instance, though it increases network traffic (the image might be around 200MB). If you prefer to build the image directly on the EC2 instance, you can slightly adjust the configuration: remove `null_resource.build_image` and modify `null_resource.remote_commands` to perform the build remotely. However, note that building the image on a `t3.small` instance may still consume significant resources and can interfere with running applications. To avoid potential downtime or performance issues, building the image locally remains the recommended approach.
12821284

12831285

12841286
### Add HTTPs and CDN

0 commit comments

Comments
 (0)