diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..3d349bd --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.10.8-alpine + + ENV FLASK_APP=app.py + ENV FLASK_RUN_HOST=0.0.0.0 + ENV LD_LIBRARY_PATH=instantclient_12_8 + RUN apk add --no-cache gcc musl-dev linux-headers + + RUN pip install -r requirements.txt + + RUN wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip + RUN unzip instantclient-basiclite-linuxx64.zip + RUN rm -f instantclient-basiclite-linuxx64.zip + RUN cd instantclient_21_8 + RUN rm -f *jdbc* *occi* *mysql* *jar uidrvci genezi adrci + RUN ld \ No newline at end of file diff --git a/backend/docker-compose.yaml b/backend/docker-compose.yaml index 05db528..c341028 100644 --- a/backend/docker-compose.yaml +++ b/backend/docker-compose.yaml @@ -6,11 +6,26 @@ services: ports: - "1521:1521" volumes: - - desktop_oracle-volume:/opt/oracle/oradata + - desktop_oracle-volume:/opt/oracle/oradata environment: - ORACLE_SID:ORCLCDB - ORACLE_PWD:password - + + flask: + build: + context: . + dockerfile: Dockerfile + ports: + - "5000:5000" + volumes: + - flask-volume:/opt/flask/flaskdata + depends_on: + oracle: + condition: service_started + command: ["python", "controllers/app.py"] + volumes: desktop_oracle-volume: - external: true + external: true + flask-volume: + external: true diff --git a/backend/requirements.txt b/backend/requirements.txt index baf38e6..e543ee1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,3 +1,3 @@ -cx-Oracle=8.3.0 +cx-Oracle==8.3.0 Flask~=2.2.2 -Flask-Cors=3.0.10 \ No newline at end of file +Flask-Cors==3.0.10 \ No newline at end of file diff --git a/backend/utils/oracleUtils.py b/backend/utils/oracleUtils.py index 64d4f02..a311005 100644 --- a/backend/utils/oracleUtils.py +++ b/backend/utils/oracleUtils.py @@ -3,12 +3,12 @@ user = 'FRUIT' password = 'FRUIT' dns = 'localhost:1521/ORCLCDB' -lib_dir = 'C:\\Users\\ranie\\Desktop\\workspace\\database_system\\resources\\instantclient-basic-windows\\instantclient_21_7' +lib_dir = 'instantclient_21_7' def get_db_connection(): - cx_Oracle.init_oracle_client(lib_dir=lib_dir) + #cx_Oracle.init_oracle_client(lib_dir=lib_dir) pool = cx_Oracle.SessionPool(user=user, password=password, dsn=dns, min=2, max=5, increment=1, encoding="UTF-8") diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..b416029 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,4 @@ +node_modules +.git +.gitignore +dist \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..459cbf9 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,8 @@ +FROM node:19.1.0-alpine +WORKDIR '/app' + +COPY package.json . +RUN npm install +COPY . . +EXPOSE 4200 +CMD ["npm", "start"] \ No newline at end of file diff --git a/frontend/docker-compose.yaml b/frontend/docker-compose.yaml new file mode 100644 index 0000000..3f94ffb --- /dev/null +++ b/frontend/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' +services: + web: + build: + context: . + dockerfile: Dockerfile + ports: + - "4200:4200" + volumes: + - /fronted/node_modules + - .:/fronted \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 2afa3cc..8fcaf54 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -2,11 +2,12 @@ "name": "frontend", "version": "0.0.0", "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "ng test" + "ng": "ng", + "start": "npx ng serve --host 0.0.0.0 --poll=500", + "build": "npx ng build --prod demo", + "test": "npx ng test --browsers=ChromeHeadless", + "lint": "npx ng lint", + "e2e": "npx ng e2e" }, "private": true, "dependencies": {