From 48507962f862a1a27a892215f58163e5c8abe371 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 20 Oct 2022 17:50:50 +0200 Subject: [PATCH] Improved docker #70-1 --- kdb-bot/cpl-workspace.json | 2 +- kdb-bot/docker-compose.yml | 4 +++- kdb-bot/dockerfile | 5 +---- kdb-web/angular.json | 4 ++-- kdb-web/dockerfile | 2 ++ kdb-web/package.json | 3 ++- 6 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 kdb-web/dockerfile diff --git a/kdb-bot/cpl-workspace.json b/kdb-bot/cpl-workspace.json index 2b1c39e132..161c6a0fc5 100644 --- a/kdb-bot/cpl-workspace.json +++ b/kdb-bot/cpl-workspace.json @@ -20,7 +20,7 @@ "prod": "export KDB_ENVIRONMENT=production; export KDB_NAME=KDB-Prod; cpl start;", "stage": "export KDB_ENVIRONMENT=staging; export KDB_NAME=KDB-Stage; cpl start;", "dev": "export KDB_ENVIRONMENT=development; export KDB_NAME=KDB-Dev; cpl start;", - "build-docker": "cpl b; docker-compose down; docker build -t kdb .", + "build-docker": "cpl b; docker-compose down; docker build -t kdb:kdb .", "compose": "docker-compose up -d", "docker": "cpl build-docker; cpl compose;" } diff --git a/kdb-bot/docker-compose.yml b/kdb-bot/docker-compose.yml index 2dc483422b..b83a787ab7 100644 --- a/kdb-bot/docker-compose.yml +++ b/kdb-bot/docker-compose.yml @@ -23,10 +23,12 @@ services: image: kdb/kdb-web:0.3 container_name: kdb_web_prod_1 depends_on: - - kdb_db_1 + - kdb_prod_1 volumes: - kdb_web_prod_1:/app restart: 'no' + ports: + - '8042:80' kdb_db_1: image: mysql:latest diff --git a/kdb-bot/dockerfile b/kdb-bot/dockerfile index b59a50a966..063c7f8d8b 100644 --- a/kdb-bot/dockerfile +++ b/kdb-bot/dockerfile @@ -4,10 +4,7 @@ FROM python:3.10.7-bullseye WORKDIR /app COPY ./dist/bot/build/ . -RUN pip install cpl-core --extra-index-url https://pip.sh-edraft.de -RUN pip install cpl-discord --extra-index-url https://pip.sh-edraft.de -RUN pip install cpl-query --extra-index-url https://pip.sh-edraft.de -RUN pip install cpl-translation --extra-index-url https://pip.sh-edraft.de +RUN pip install -r requirements.txt --extra-index-url https://pip.sh-edraft.de RUN apt-get update -y RUN apt-get install nano -y diff --git a/kdb-web/angular.json b/kdb-web/angular.json index ee3ffca437..bc0d967006 100644 --- a/kdb-web/angular.json +++ b/kdb-web/angular.json @@ -40,8 +40,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "8mb", + "maximumError": "16mb" }, { "type": "anyComponentStyle", diff --git a/kdb-web/dockerfile b/kdb-web/dockerfile new file mode 100644 index 0000000000..4564d92066 --- /dev/null +++ b/kdb-web/dockerfile @@ -0,0 +1,2 @@ +FROM nginx:alpine +COPY ./dist/kdb-web/ /usr/share/nginx/html diff --git a/kdb-web/package.json b/kdb-web/package.json index e38246960c..d4f71ecdba 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -9,7 +9,8 @@ "prebuild": "npm run update-version", "build": "ng build", "watch": "ng build --watch --configuration development", - "test": "ng test" + "test": "ng test", + "build-docker": "ng build; docker build -t kdb-web:kdb-web ." }, "private": true, "dependencies": {