Skip to content

Commit

Permalink
stop trying mr anderson
Browse files Browse the repository at this point in the history
  • Loading branch information
zkhrg committed Jun 5, 2024
1 parent 5ff6631 commit 86114e7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt

ENV PYTHONUNBUFFERED=1

CMD ["uvicorn", "app.main:app", "--host", "localhost", "--port", "8000"]
CMD ["uvicorn", "app.main:app", "--host", "172.19.0.2", "--port", "8000"]
3 changes: 2 additions & 1 deletion api/app/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import redis
import os

REDIS_HOST = "redis"
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = 6379
REDIS_DB = 0
PEERS_KEY = 'peers'
Expand Down
28 changes: 21 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ services:
- .env
depends_on:
- redis
expose:
- "8000"
- "6379"
networks:
- my-network
fbnet:
ipv4_address: 172.19.0.2

frontend:
restart: always
Expand All @@ -20,9 +24,12 @@ services:
- .env
depends_on:
- api
expose:
- "8000"
networks:
- my-network

fbnet:
ipv4_address: 172.19.0.3

parser:
restart: always
build:
Expand All @@ -32,7 +39,8 @@ services:
depends_on:
- api
networks:
- my-network
fbnet:
ipv4_address: 172.19.0.4
# ports:
# - 80:80
# - 433:433
Expand All @@ -45,9 +53,12 @@ services:
- .env
volumes:
- ./backup:/backup
command: sleep infinity
# command: sleep infinity
networks:
- my-network
fbnet:
ipv4_address: 172.19.0.5
expose:
- "6379"

# selenium-hub:
# image: selenoid/chrome:latest
Expand All @@ -57,5 +68,8 @@ services:
# - "4444:4444"

networks:
my-network:
fbnet:
driver: bridge
ipam:
config:
- subnet: 172.19.0.0/16
1 change: 1 addition & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM python:3.10.2
RUN apt update && apt install iputils-ping -y

WORKDIR /frontend
COPY . .
Expand Down
6 changes: 3 additions & 3 deletions frontend/api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from datetime import datetime
from typing import List, Dict

API_ADDRESS = os.getenv("API_ADDRESS", "localhost")
API_PORT = os.getenv("API_PORT", "8000" )
API_ADDRESS = os.getenv("API_ADDRESS", "dicksuckerapi")
API_PORT = os.getenv("API_PORT", ":8000")


def get_peer_status(peer_name: str) -> str:
data = {"peer_name": peer_name}
resp = requests.post(API_ADDRESS + ":" + API_PORT +
resp = requests.post(API_ADDRESS + API_PORT +
"/get_peer_status/", json=data)
resp = resp.json()

Expand Down
10 changes: 5 additions & 5 deletions redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM redis:latest

FROM python:3.10.2
# FROM python:3.10.2

WORKDIR /redis
COPY . .
# WORKDIR /redis
# COPY . .

RUN pip install --no-cache-dir -r requirements.txt
# RUN pip install --no-cache-dir -r requirements.txt

ENV PYTHONUNBUFFERED=1
# ENV PYTHONUNBUFFERED=1

# CMD ["python3", "main.py"]

0 comments on commit 86114e7

Please sign in to comment.