This commit is contained in:
Piotr Biernat 2022-10-06 20:40:27 +02:00
parent a811386ee3
commit 2da3dd13d1
16 changed files with 95 additions and 25 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.idea/
deploy/*.local.yml

15
.gitmodules vendored
View File

@ -1,15 +0,0 @@
[submodule "services/basket"]
path = services/basket
url = git@git.pbiernat.dev:egommerce/basket-service.git
[submodule "services/catalog"]
path = services/catalog
url = git@git.pbiernat.dev:egommerce/catalog-service.git
[submodule "services/identity"]
path = services/identity
url = git@git.pbiernat.dev:egommerce/identity-service.git
[submodule "services/notification"]
path = services/notification
url = git@git.pbiernat.dev:egommerce/notification-service.git
[submodule "services/ordering"]
path = services/ordering
url = git@git.pbiernat.dev:egommerce/ordering-service.git

View File

View File

@ -1,3 +1,3 @@
# application
# stack
Main application - includes all microservices
Egommerce docker stack

View File

View File

@ -0,0 +1,9 @@
-- 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;

View File

@ -0,0 +1,21 @@
version: "3.9"
services:
postgres_svc:
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=12345678
identity_svc:
environment:
- DATABASE_URL=postgres://postgres:12345678@postgres_svc:5432/egommerce
basket_svc:
environment:
- DATABASE_URL=postgres://postgres:12345678@postgres_svc:5432/egommerce
volumes:
postgres_data: ~

View File

@ -0,0 +1,51 @@
version: "3.9"
services:
postgres_svc:
image: postgres:14.1-alpine
# hostname: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=SuPerTrudneHasloNaKoniecTrzebaWygenerowac
networks:
- postgres_network
apigw_svc:
image: git.pbiernat.dev/egommerce/apigw-svc:latest # fixme :stable
networks:
- apigw_network
- identity_network
- basket_network
identity_svc:
image: git.pbiernat.dev/egommerce/identity-svc:latest # fixme :stable
environment:
- DATABASE_URL=postgres://PROD_IDENTITY_USER:PROD_PASS@postgres_svc:5432/PROD_DATABASE
networks:
- identity_network
- postgres_network
basket_svc:
image: egommerce_basket:latest
environment:
- DATABASE_URL=postgres://PROD_BASKET_USER:PROD_PASS@postgres_svc:5432/PROD_DATABASE
networks:
- basket_network
- postgres_network
networks:
postgres_network:
driver: overlay
internal: true
apigw_network:
driver: overlay
internal: true
identity_network:
driver: overlay
internal: true
basket_network:
driver: overlay
internal: true

10
deploy/stack-start.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# FIX paths...
echo "Starting egommerce stack..."
docker stack deploy --with-registry-auth \
--compose-file deployments/egommerce-stack.yml \
--compose-file deployments/egommerce-stack.dev.yml \
--compose-file deployments/egommerce-stack.dev.local.yml \
egommerce
echo "Done."

3
go.mod
View File

@ -1,3 +0,0 @@
module git.pbiernat.dev/egommerce/application
go 1.18

@ -1 +0,0 @@
Subproject commit c4134dc7a28956a7124ffbf2891c2762e7d916ce

@ -1 +0,0 @@
Subproject commit cc115fb4c989000b8d056773903787871a95d842

@ -1 +0,0 @@
Subproject commit 748b631d0c805b3a4c082ab5962fec0e4815e643

@ -1 +0,0 @@
Subproject commit a939b791aded01fa14413a6e98eb03cbfe4801e2

@ -1 +0,0 @@
Subproject commit 508ae5a554193b98957ef5b66853df5c8986fbc0