Skip to content

Commit

Permalink
docker: add dns
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed Mar 24, 2024
1 parent 62f284c commit a4db8f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# duckduckgo_search_api

Fastapi code to deploy an API that pulls data from duckduckgo search engine.
Deploy an API that pulls data from duckduckgo search engine.
___
## 1) Usage
**clone**
Expand Down Expand Up @@ -33,20 +33,12 @@ docker-compose up --build
```
___
## 3) Docker
**build**
```python3
docker build -t duckduckgo_search .
# build
docker build -t ddgs .
# run
docker run -d --name ddgs -p 8000:8000 --dns 1.1.1.1 --dns 8.8.8.8 ddgs
```

**run**
```python3
docker run -d --name ddg -p 8000:8000 duckduckgo_search
```
or
```python3
docker run -d --network host --name ddg -p 8000:8000 duckduckgo_search
```

___
## 4) Test
```python3
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ services:
ddgs:
build:
context: .
network: host
command: uvicorn duckduckgo_search_api.main:app --host 0.0.0.0 --port 8000
ports:
- "8000:8000"
- "8000:8000"
dns:
- 1.1.1.1
- 8.8.8.8

0 comments on commit a4db8f3

Please sign in to comment.