update
This commit is contained in:
parent
317d1a871b
commit
6042f81c35
@ -1,9 +0,0 @@
|
||||
-- TODO: Add variables for db, user name, etc...
|
||||
|
||||
CREATE DATABASE svc_identity
|
||||
WITH
|
||||
OWNER = postgres
|
||||
ENCODING = 'UTF8'
|
||||
CONNECTION LIMIT = -1;
|
||||
|
||||
GRANT ALL ON DATABASE svc_identity TO postgres;
|
@ -0,0 +1,2 @@
|
||||
DROP TABLE IF EXISTS basket.basket_item;
|
||||
DROP TABLE IF EXISTS basket.basket;
|
@ -0,0 +1,34 @@
|
||||
CREATE TABLE IF NOT EXISTS basket.basket
|
||||
(
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
state character varying NOT NULL DEFAULT 'new',
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS basket.basket_item
|
||||
(
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
basket_id uuid NOT NULL,
|
||||
product_id integer NOT NULL,
|
||||
quantity integer NOT NULL DEFAULT 1,
|
||||
price double precision NOT NULL DEFAULT 0.00;
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE IF EXISTS basket.basket_item
|
||||
ADD CONSTRAINT basket_item_basket_fkey FOREIGN KEY (basket_id)
|
||||
REFERENCES basket.basket (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE NO ACTION
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE IF EXISTS basket.basket
|
||||
OWNER to postgres;
|
||||
|
||||
ALTER TABLE IF EXISTS basket.basket_item
|
||||
OWNER to postgres;
|
||||
-- TODO ^^ PRIVILEGES...
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE IF EXISTS basket.basket_item
|
||||
DROP COLUMN price;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE IF EXISTS basket.basket_item
|
||||
ADD COLUMN price double precision NOT NULL DEFAULT 0.00;
|
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS catalog.product;
|
@ -0,0 +1,16 @@
|
||||
CREATE TABLE catalog.product
|
||||
(
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
pid character varying NOT NULL,
|
||||
name character varying NOT NULL,
|
||||
price double precision NOT NULL,
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE IF EXISTS catalog.product
|
||||
OWNER to postgres;
|
||||
|
||||
COMMENT ON COLUMN catalog.product.pid
|
||||
IS 'Unique product ID. EAN, UPC etc...';
|
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS identity.users;
|
@ -0,0 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS identity.users
|
||||
(
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
username character varying NOT NULL,
|
||||
email character varying NOT NULL,
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE IF EXISTS identity.users
|
||||
OWNER to postgres;
|
@ -0,0 +1,2 @@
|
||||
DROP TABLE IF EXISTS ordering.order_item;
|
||||
DROP TABLE IF EXISTS ordering."order";
|
@ -0,0 +1,34 @@
|
||||
CREATE TABLE IF NOT EXISTS ordering."order"
|
||||
(
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
state character varying NOT NULL DEFAULT 'new',
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ordering.order_item
|
||||
(
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
order_id uuid NOT NULL,
|
||||
product_id integer NOT NULL,
|
||||
quantity integer NOT NULL DEFAULT 1,
|
||||
price double precision NOT NULL DEFAULT 0.00;
|
||||
created_at timestamp without time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp without time zone,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
ALTER TABLE IF EXISTS ordering.order_item
|
||||
ADD CONSTRAINT order_item_order_fkey FOREIGN KEY (order_id)
|
||||
REFERENCES "ordering"."order" (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE NO ACTION
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE IF EXISTS "ordering"."order"
|
||||
OWNER to postgres;
|
||||
|
||||
ALTER TABLE IF EXISTS "ordering".order_item
|
||||
OWNER to postgres;
|
||||
-- TODO ^^ PRIVILEGES...
|
@ -15,7 +15,6 @@ services:
|
||||
# - "traefik.http.routers.api-gateway-api.rule=PathPrefix(`/api`)"
|
||||
# - "traefik.http.routers.api-gateway-api.service=api@internal"
|
||||
# - "traefik.http.routers.api-gateway-api.middlewares=PathPrefix(`/`)"
|
||||
# - "traefik.http.routers.api-gateway.tls=true"
|
||||
# - "traefik.http.routers.api-gateway.rule=Headers(`X-API-SERVICE`, `admin-gateway`)"
|
||||
# - "traefik.http.routers.api-gateway.tls=true"
|
||||
# - "traefik.http.routers.api-gateway.entryPoints=https"
|
||||
@ -32,6 +31,7 @@ services:
|
||||
hostname: registry.egommerce.pbiernat.dev
|
||||
environment:
|
||||
- APP_DOMAIN=registry.egommerce.pbiernat.dev
|
||||
- CONSUL_HTTP_TOKEN=devop
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.api-registry.rule=PathPrefix(`/admin/registry`)"
|
||||
@ -73,6 +73,11 @@ services:
|
||||
# volumes:
|
||||
# - ./certs/api-gateway:/certs
|
||||
|
||||
api-cache:
|
||||
image: git.pbiernat.dev/egommerce/api-cache:dev
|
||||
environment:
|
||||
- PASSWORD=12345678
|
||||
|
||||
api-logger:
|
||||
image: git.pbiernat.dev/egommerce/api-logger:dev
|
||||
hostname: logger.egommerce.pbiernat.dev
|
||||
@ -132,6 +137,16 @@ services:
|
||||
volumes:
|
||||
- ./certs/api-gateway:/certs
|
||||
|
||||
pricing-svc:
|
||||
image: git.pbiernat.dev/egommerce/pricing-svc:dev
|
||||
environment:
|
||||
- APP_DOMAIN=pricing.api.egommerce.pbiernat.dev
|
||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@eventbus.egommerce.pbiernat.dev:5672
|
||||
volumes:
|
||||
- ./certs/api-gateway:/certs
|
||||
|
||||
order-svc:
|
||||
image: git.pbiernat.dev/egommerce/order-svc:dev
|
||||
environment:
|
||||
@ -145,8 +160,8 @@ services:
|
||||
# Workers (EventBus)
|
||||
basket-worker:
|
||||
image: git.pbiernat.dev/egommerce/basket-worker:dev
|
||||
deploy:
|
||||
replicas: 2
|
||||
# deploy:
|
||||
# replicas: 2
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||
@ -154,8 +169,17 @@ services:
|
||||
|
||||
catalog-worker:
|
||||
image: git.pbiernat.dev/egommerce/catalog-worker:dev
|
||||
deploy:
|
||||
replicas: 2
|
||||
# deploy:
|
||||
# replicas: 2
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||
- EVENTBUS_URL=amqp://guest:guest@eventbus.egommerce.pbiernat.dev:5672
|
||||
|
||||
pricing-worker:
|
||||
image: git.pbiernat.dev/egommerce/pricing-worker:dev
|
||||
# deploy:
|
||||
# replicas: 2
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||
@ -163,8 +187,8 @@ services:
|
||||
|
||||
order-worker:
|
||||
image: git.pbiernat.dev/egommerce/order-worker:dev
|
||||
deploy:
|
||||
replicas: 2
|
||||
# deploy:
|
||||
# replicas: 2
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||
|
@ -12,10 +12,6 @@ services:
|
||||
networks:
|
||||
- api-gateway-network
|
||||
# - api-logger-network # TODO
|
||||
- identity-svc-network
|
||||
- basket-svc-network
|
||||
- catalog-svc-network
|
||||
- order-svc-network
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
@ -24,19 +20,13 @@ services:
|
||||
environment:
|
||||
- APP_NAME=api-registry
|
||||
- APP_DOMAIN
|
||||
- CONSUL_HTTP_TOKEN=VeryS3cr3tTok3N
|
||||
volumes:
|
||||
- registry_data:/consul/data
|
||||
networks:
|
||||
- api-registry-network
|
||||
# - api-logger-network # TODO
|
||||
- api-gateway-network
|
||||
- identity-svc-network
|
||||
- basket-svc-network
|
||||
- catalog-svc-network
|
||||
- order-svc-network
|
||||
- basket-worker-network
|
||||
- catalog-worker-network
|
||||
- order-worker-network
|
||||
|
||||
api-eventbus:
|
||||
image: git.pbiernat.dev/egommerce/api-eventbus:latest
|
||||
@ -58,6 +48,14 @@ services:
|
||||
- api-registry-network
|
||||
- api-logger-network
|
||||
|
||||
api-cache:
|
||||
image: git.pbiernat.dev/egommerce/api-cache:latest
|
||||
environment:
|
||||
- APP_NAME=api-cache
|
||||
networks:
|
||||
- api-cache-network
|
||||
- api-logger-network
|
||||
|
||||
api-logger:
|
||||
image: git.pbiernat.dev/egommerce/api-logger:latest
|
||||
environment:
|
||||
@ -107,13 +105,18 @@ services:
|
||||
image: git.pbiernat.dev/egommerce/identity-svc:latest
|
||||
environment:
|
||||
- APP_NAME=identity-svc
|
||||
- APP_PATH_PREFIX=/identity
|
||||
- APP_DOMAIN
|
||||
- APP_KV_NAMESPACE
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
volumes:
|
||||
- ./db_migrations/identity-svc:/migrations
|
||||
networks:
|
||||
- identity-svc-network
|
||||
- api-gateway-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -123,13 +126,18 @@ services:
|
||||
image: git.pbiernat.dev/egommerce/basket-svc:latest
|
||||
environment:
|
||||
- APP_NAME=basket-svc
|
||||
- APP_PATH_PREFIX=/basket
|
||||
- APP_DOMAIN
|
||||
- APP_KV_NAMESPACE
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
volumes:
|
||||
- ./db_migrations/basket-svc:/migrations
|
||||
networks:
|
||||
- basket-svc-network
|
||||
- api-gateway-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -139,13 +147,39 @@ services:
|
||||
image: git.pbiernat.dev/egommerce/catalog-svc:latest
|
||||
environment:
|
||||
- APP_NAME=catalog-svc
|
||||
- APP_PATH_PREFIX=/catalog
|
||||
- APP_DOMAIN
|
||||
- APP_KV_NAMESPACE
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
volumes:
|
||||
- ./db_migrations/catalog-svc:/migrations
|
||||
networks:
|
||||
- catalog-svc-network
|
||||
- api-gateway-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
- mongodb-db-network
|
||||
|
||||
pricing-svc:
|
||||
image: git.pbiernat.dev/egommerce/pricing-svc:latest
|
||||
environment:
|
||||
- APP_NAME=pricing-svc
|
||||
- APP_PATH_PREFIX=/pricing
|
||||
- APP_DOMAIN
|
||||
- APP_KV_NAMESPACE
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
volumes:
|
||||
- ./db_migrations/pricing-svc:/migrations
|
||||
networks:
|
||||
- pricing-svc-network
|
||||
- api-gateway-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -155,13 +189,18 @@ services:
|
||||
image: git.pbiernat.dev/egommerce/order-svc:latest
|
||||
environment:
|
||||
- APP_NAME=order-svc
|
||||
- APP_PATH_PREFIX=/order
|
||||
- APP_DOMAIN
|
||||
- APP_KV_NAMESPACE
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
volumes:
|
||||
- ./db_migrations/order-svc:/migrations
|
||||
networks:
|
||||
- order-svc-network
|
||||
- api-gateway-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -178,6 +217,8 @@ services:
|
||||
- EVENTBUS_URL
|
||||
networks:
|
||||
- basket-worker-network
|
||||
- pricing-svc-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -192,6 +233,22 @@ services:
|
||||
- EVENTBUS_URL
|
||||
networks:
|
||||
- catalog-worker-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
- mongodb-db-network
|
||||
|
||||
pricing-worker:
|
||||
image: git.pbiernat.dev/egommerce/pricing-worker:latest
|
||||
environment:
|
||||
- APP_NAME=pricing-worker
|
||||
- DATABASE_URL
|
||||
- MONGODB_URL
|
||||
- EVENTBUS_URL
|
||||
networks:
|
||||
- pricing-worker-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -206,6 +263,8 @@ services:
|
||||
- EVENTBUS_URL
|
||||
networks:
|
||||
- order-worker-network
|
||||
- basket-svc-network
|
||||
- api-registry-network
|
||||
- api-eventbus-network
|
||||
- api-logger-network
|
||||
- postgres-db-network
|
||||
@ -231,6 +290,10 @@ networks:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
api-cache-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
api-logger-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
@ -256,6 +319,10 @@ networks:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
pricing-svc-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
order-svc-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
@ -273,6 +340,10 @@ networks:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
pricing-worker-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
||||
order-worker-network:
|
||||
driver: overlay
|
||||
internal: true
|
||||
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"node_name": "api-registry",
|
||||
"server": true,
|
||||
"bootstrap" : true,
|
||||
"ui_config": {
|
||||
"enabled" : true
|
||||
},
|
||||
"data_dir": "/consul/data",
|
||||
"addresses": {
|
||||
"http" : "0.0.0.0"
|
||||
},
|
||||
"bind_addr": "0.0.0.0",
|
||||
"advertise_addr": "127.0.0.1"
|
||||
}
|
Loading…
Reference in New Issue
Block a user