diff --git a/pom.xml b/pom.xml index 619fc7a..33d90cc 100644 --- a/pom.xml +++ b/pom.xml @@ -103,6 +103,42 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + 0.26.0 + true + + true + + + hk-backend + + java:8-jdk-alpine + + + java + -jar + /maven/${project.artifactId}-${project.version}.jar + + + + artifact + + + + + + + + build + post-integration-test + + build + + + + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 45ca656..d662075 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,12 +1,12 @@ # My Local Environment -server.port=8000 +server.port=${SERVER_PORT:8100} # DataSource Configuration -spring.datasource.url=jdbc:postgresql://localhost:5432/issuemanagment -spring.datasource.username=postgres -spring.datasource.password=postgres +spring.datasource.url=jdbc:postgresql://hk-pg-server:5432/issuemanagment +spring.datasource.username=${DB_USERNAME:postgres} +spring.datasource.password=${DB_PASS:postgres} spring.jpa.show-sql=true #CodeFirst, DbFirst diff --git a/src/main/resources/docker-compose.yml b/src/main/resources/docker-compose.yml new file mode 100644 index 0000000..c3b4060 --- /dev/null +++ b/src/main/resources/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3.1' + +networks: + haydikodlayalim: + +services: + db: + image: postgres + container_name: hk-pg-server + hostname: hk-pg-server + networks: + - haydikodlayalim + ports: + - '5432:5432' + environment: + POSTGRES_PASSWORD: postgres + + backend: + image: hk-backend + container_name: hk-backend-server + hostname: hk-backend-server + ports: + - '8100:8100' + restart: always + networks: + - haydikodlayalim + + frontend: + image: hk-frontend + container_name: hk-frontend-server + hostname: hk-frontend-server + ports: + - '8200:80' + restart: always + networks: + - haydikodlayalim \ No newline at end of file diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile new file mode 100644 index 0000000..227857b --- /dev/null +++ b/src/webui/Dockerfile @@ -0,0 +1,15 @@ +# BUILD STAGE +FROM node as node + +WORKDIR /issuemanagement + +COPY . . + +RUN npm install +RUN npm install -s node-sass +RUN npm run build + + +# DEPLOYMENT STAGE +FROM nginx +COPY --from=node /issuemanagement/dist /usr/share/nginx/html diff --git a/src/webui/angular.json b/src/webui/angular.json index 8acf77d..13dbdab 100644 --- a/src/webui/angular.json +++ b/src/webui/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "../../public", + "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", diff --git a/src/webui/package.json b/src/webui/package.json index b80fc07..00a104b 100644 --- a/src/webui/package.json +++ b/src/webui/package.json @@ -34,6 +34,7 @@ "ngx-bootstrap": "^3.0.0", "ngx-loading": "^3.0.1", "ngx-toastr": "^9.1.1", + "node-sass": "^4.14.0", "popper.js": "^1.14.3", "rxjs": "^6.2.1", "rxjs-compat": "^6.2.1", diff --git a/src/webui/src/environments/environment.ts b/src/webui/src/environments/environment.ts index 6525f30..af62560 100644 --- a/src/webui/src/environments/environment.ts +++ b/src/webui/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - API_BASE_PATH:"http://localhost:8000/api" + API_BASE_PATH:"http://localhost:8100/api" }; /*