Skip to content

Commit 9d8ff54

Browse files
Merge pull request #21 from CoolCoderCarl/feature/FUNC_6
Feature/func 6
2 parents f632f32 + efffced commit 9d8ff54

3 files changed

Lines changed: 24 additions & 23 deletions

File tree

Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ COPY requirements.txt requirements.txt
1010

1111
RUN pip3 install -U pip
1212
RUN pip3 install --no-cache-dir -r requirements.txt
13+
RUN apt update -y && \
14+
apt install curl jq -y
1315

1416
FROM builder
1517

datapath.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232

3333
def check_api_available() -> bool:
3434
try:
35-
logging.info(f"Try to connect to API, URL: {NEWS_DB_API_URL}")
36-
return requests.get(NEWS_DB_API_URL).ok
35+
logging.info(f"Try to connect to API, URL: {NEWS_DB_API_URL}/healthcheck")
36+
time.sleep(1)
37+
return requests.get(f"{NEWS_DB_API_URL}/healthcheck").ok
3738
except (ConnectionError, ConnectionRefusedError) as con_err:
3839
logging.error(con_err)
3940

docker-compose.yaml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
11
version: '3'
22

33
services:
4-
# news_db:
5-
# container_name: news_db
6-
# image: h0d0user/news_db:latest
7-
# pull_policy: always
8-
# restart: always
9-
# network_mode: host
10-
# volumes:
11-
# - "shared-volume:/mnt/"
12-
# - "./settings.toml:/opt/settings.toml"
4+
attainments_sanctuary:
5+
container_name: attainments_sanctuary
6+
image: h0d0user/attainments_sanctuary:latest
7+
pull_policy: always
8+
restart: always
9+
networks:
10+
- etl
11+
ports:
12+
- "8888:8888"
13+
# healthcheck:
14+
# test: "curl http://attainments_sanctuary:8888/healthcheck | jq -r '.healthcheck'"
15+
# interval: 5s
16+
# timeout: 5s
17+
# retries: 20
18+
# start_period: 5s
1319

1420
epistolary:
1521
container_name: epistolary
1622
image: h0d0user/epistolary:latest
1723
pull_policy: always
1824
restart: always
19-
# network_mode: host
2025
networks:
2126
- etl
2227
hostname: epistolary
23-
ports:
24-
- "8888:8888"
25-
# depends_on:
26-
# - "news_db"
28+
depends_on:
29+
- "attainments_sanctuary"
2730
volumes:
28-
# - "shared-volume:/mnt/"
2931
- "./settings.toml:/opt/settings.toml"
3032

3133
datapath:
3234
container_name: datapath
3335
image: h0d0user/datapath:latest
3436
pull_policy: always
3537
restart: always
36-
# network_mode: host
3738
networks:
3839
- etl
3940
depends_on:
40-
- "epistolary"
41+
- "attainments_sanctuary"
4142
volumes:
4243
- "./settings.toml:/opt/settings.toml"
4344

44-
volumes:
45-
shared-volume:
46-
4745
networks:
48-
etl:
46+
etl:

0 commit comments

Comments
 (0)