From 9ae780353c81082a05a6e43d1a44939e1724b45b Mon Sep 17 00:00:00 2001 From: Victor <victor.calleja.garcia@estudiantes.uva.es> Date: Tue, 10 Dec 2024 16:44:00 +0100 Subject: [PATCH] finish --- .../app/shared/cliente-api-rest.service.ts | 2 +- docker-compose.yml | 100 ++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/angularVinos/src/app/shared/cliente-api-rest.service.ts b/angularVinos/src/app/shared/cliente-api-rest.service.ts index 215f058..1c6b520 100644 --- a/angularVinos/src/app/shared/cliente-api-rest.service.ts +++ b/angularVinos/src/app/shared/cliente-api-rest.service.ts @@ -8,7 +8,7 @@ import { Observable } from 'rxjs'; }) export class ClienteApiRestService { - private static readonly BASE_URI = 'http://localhost:8080/ejemploVinos'; + private static readonly BASE_URI = 'http://localhost:8000/api/vinos'; constructor (private http: HttpClient) {} // Inyectamos el servicio HttpClient diff --git a/docker-compose.yml b/docker-compose.yml index 44544be..c63842a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,106 @@ networks: # Red interna para comunicar los servicios kong-net: {} services: +####################################### +# Postgres: The database used by Kong +####################################### + kong-database: + image: postgres:9.6 + container_name: kong-postgres + restart: on-failure + networks: + - kong-net + volumes: + - kong_data:/var/lib/postgresql/data + environment: + POSTGRES_USER: kong + POSTGRES_PASSWORD: ${KONG_PG_PASSWORD:-kong} + POSTGRES_DB: kong + ports: + - "5432:5432" + healthcheck: + test: ["CMD", "pg_isready", "-U", "kong"] + interval: 30s + timeout: 30s + retries: 3 +####################################### +# Kong database migration +####################################### + kong-migration: + image: ${KONG_DOCKER_TAG:-kong:latest} + command: kong migrations bootstrap + networks: + - kong-net + restart: on-failure + environment: + KONG_DATABASE: postgres + KONG_PG_HOST: kong-database + KONG_PG_DATABASE: kong + KONG_PG_USER: kong + KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} + depends_on: + kong-database: + condition: service_healthy +####################################### +# Kong: The API Gateway +####################################### + kong: + image: ${KONG_DOCKER_TAG:-kong:latest} + restart: on-failure + networks: + - kong-net + environment: + KONG_DATABASE: postgres + KONG_PG_HOST: kong-database + KONG_PG_DATABASE: kong + KONG_PG_USER: kong + KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} + KONG_PROXY_LISTEN: 0.0.0.0:8000 + KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443 + KONG_ADMIN_LISTEN: 0.0.0.0:8001 + depends_on: + kong-database: + condition: service_healthy + healthcheck: + test: ["CMD", "kong", "health"] + interval: 10s + timeout: 10s + retries: 10 + ports: + - "8000:8000" + - "8001:8001" + - "8443:8443" + - "8444:8444" +####################################### +# Konga database prepare +####################################### + konga-prepare: + image: pantsel/konga:latest + command: "-c prepare -a postgres -u postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga" + networks: + - kong-net + restart: on-failure + depends_on: + kong-database: + condition: service_healthy +####################################### +# Konga: Kong GUI +####################################### + konga: + image: pantsel/konga:latest + restart: always + networks: + - kong-net + environment: + DB_ADAPTER: postgres + DB_URI: postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga + NODE_ENV: production + depends_on: + kong-database: + condition: service_healthy + ports: + - "1337:1337" + front: image: my-angular-app build: -- GitLab