From a4db8f3359ab99edd9faef666b4ac49acb00696e Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Sun, 24 Mar 2024 15:19:55 +0300 Subject: [PATCH] docker: add dns --- README.md | 18 +++++------------- docker-compose.yml | 6 ++++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index bea1a17..af4edc9 100644 --- a/README.md +++ b/README.md @@ -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** @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 87663ab..aa8482c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" \ No newline at end of file + - "8000:8000" + dns: + - 1.1.1.1 + - 8.8.8.8 \ No newline at end of file