mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:43:12 +02:00
jeszcze niedziałająca konteneryzacja dockera
This commit is contained in:
parent
9808014e53
commit
ff722f72bf
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
connector/Lib/*
|
||||||
|
connector/Scripts/*
|
||||||
|
pyvenv.cfg
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM python:3.11-bullseye
|
||||||
|
|
||||||
|
WORKDIR /code
|
||||||
|
|
||||||
|
COPY ./connector/Include/*.* .
|
||||||
|
COPY ./connector/Include/init_scripts/*.* ./init_scripts/*.*
|
||||||
|
|
||||||
|
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
25
README.md
25
README.md
@ -1 +1,26 @@
|
|||||||
# Projekt z ERSMS
|
# Projekt z ERSMS
|
||||||
|
|
||||||
|
|
||||||
|
## Backend
|
||||||
|
|
||||||
|
### instalacja:
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
### budowanie i uruchamianie obrazu z bazą danych:
|
||||||
|
docker compose up (ewentualnie można też z GUI)
|
||||||
|
|
||||||
|
### uruchomienie:
|
||||||
|
(Z directory macierzystego)
|
||||||
|
python3 ai_front_connector/frontend_AI_connector.py
|
||||||
|
|
||||||
|
### gadanie z endpointami
|
||||||
|
|
||||||
|
GET http://localhost:8090/ - testowy domowy
|
||||||
|
|
||||||
|
GET http://localhost:8090//api/v3/get/<string:username> - info o userach
|
||||||
|
|
||||||
|
GET http://localhost:8090//api/v3/get_movie/<int:movie_ID> - info o filmie
|
||||||
|
|
||||||
|
POST http://localhost:8090/api/v3/add/<string:oauth_ID>/<string:username> - dodawanie usera
|
||||||
|
|
||||||
|
GET http://localhost:8090/api/v3/ai/<string:oauth_ID> - wyciąganie rekomendacji od AI
|
||||||
@ -1 +0,0 @@
|
|||||||
FROM python:3.10.4-slim-bullseye
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
# instalacja:
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# budowanie i uruchamianie obrazu z bazą danych:
|
|
||||||
cd ai_front_connector
|
|
||||||
docker compose up (ewentualnie można też z GUI)
|
|
||||||
|
|
||||||
# uruchomienie:
|
|
||||||
(Z directory macierzystego)
|
|
||||||
python3 ai_front_connector/frontend_AI_connector.py
|
|
||||||
|
|
||||||
# gadanie z endpointami
|
|
||||||
|
|
||||||
GET http://localhost:8080/ - testowy domowy
|
|
||||||
|
|
||||||
GET http://localhost:8080//api/v3/get/<string:username> - info o userach
|
|
||||||
|
|
||||||
POST http://localhost:8080/api/v3/add/<string:oauth_ID>/<string:username> - dodawanie usera
|
|
||||||
|
|
||||||
GET http://localhost:8080/api/v3/ai/<string:oauth_ID> - wyciąganie rekomendacji od AI
|
|
||||||
|
|
||||||
@ -1 +0,0 @@
|
|||||||
{"_default": {"1": {"ID": "123123", "username": "ziom69"}, "2": {"ID": "123123", "username": "ziom66"}}}
|
|
||||||
@ -67,7 +67,7 @@ def get_movie(movie_ID):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
config.read("ai_front_connector/init_scripts/constants.ini")
|
config.read("init_scripts/constants.ini")
|
||||||
|
|
||||||
conn = psycopg2.connect(
|
conn = psycopg2.connect(
|
||||||
host=config["postgres"]["host"],
|
host=config["postgres"]["host"],
|
||||||
@ -79,6 +79,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
movie_list = pandas.read_csv(config["movie"]["csv_path"])
|
movie_list = pandas.read_csv(config["movie"]["csv_path"])
|
||||||
|
|
||||||
app.run(port=8080, debug=True)
|
app.run(host="0.0.0.0",port=8090, debug=True)
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
[postgres]
|
[postgres]
|
||||||
host=localhost
|
host=db
|
||||||
database=test_db
|
database=test_db
|
||||||
user=root
|
user=root
|
||||||
password=root
|
password=root
|
||||||
port=5432
|
port=5432
|
||||||
|
|
||||||
[movie]
|
[movie]
|
||||||
csv_path=ai_front_connector/init_scripts/movies.csv
|
csv_path=init_scripts/movies.csv
|
||||||
|
Can't render this file because it is too large.
|
@ -1,6 +1,17 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
connector:
|
||||||
|
container_name: connector_container
|
||||||
|
build: .
|
||||||
|
volumes:
|
||||||
|
- .:/code
|
||||||
|
ports:
|
||||||
|
- 8090:8090
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
command:
|
||||||
|
- python3 ./frontend_AI_connector.py
|
||||||
db:
|
db:
|
||||||
container_name: db_container
|
container_name: db_container
|
||||||
image: postgres:13
|
image: postgres:13
|
||||||
@ -11,7 +22,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
volumes:
|
volumes:
|
||||||
- ./init_scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
- postgres_data:/var/lib/postgresql/data/
|
- postgres_data:/var/lib/postgresql/data/
|
||||||
pgadmin:
|
pgadmin:
|
||||||
container_name: admin_container
|
container_name: admin_container
|
||||||
Loading…
Reference in New Issue
Block a user