Skip to content

Commit

Permalink
fix: adding multiple database flavors
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoPires committed Apr 19, 2022
1 parent c22b9df commit cad806b
Show file tree
Hide file tree
Showing 38 changed files with 428 additions and 52 deletions.
230 changes: 230 additions & 0 deletions docker/docker-compose-local-light.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
version: "3"

services:

generate-pfx:
image: emberstack/openssl
container_name: generate-pfx
volumes:
- ./certs:/https:rw
command: >
sh -c "[ -e "./https/devstore.academy-localhost.pfx" ] && echo File Already exist || (
rm /https/devstore.academy-localhost.pfx &&
openssl genrsa -out devstore.rsa 2048 &&
openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' &&
openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt &&
openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe &&
rm devstore.rsa devstore.csr devstore.crt)"
devstore-rabbit:
image: rabbitmq:3-management
container_name: devstore-rabbit
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"

web-mvc:
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
container_name: devstore-web-mvc-ecommerce
build:
context: ../src
dockerfile: ./web/DevStore.WebApp.MVC/Dockerfile
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Docker
- ASPNETCORE_URLS=http://*:5001
- LC_ALL=en_US.UTF-8
- LANG=en_US.UTF-8
# Change the two lines above to your culture (ex pt_BR)
volumes:
- dpkeys:/var/data_protection_keys/
depends_on:
- api-catalog
- api-identity
- api-customers
- api-bff-checkout
- generate-pfx

database-devstore:
image: mcr.microsoft.com/mssql/server:2017-latest
container_name: database-devstore
ports:
- 1433:1433
environment:
SA_PASSWORD: "MyDB@123"
ACCEPT_EULA: "Y"

api-identity:
image: desenvolvedorio/devstore-api-identity:latest
container_name: devstore-api-identity
build:
context: ../src
dockerfile: ./services/DevStore.Identity.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5101;http://+5102
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- database-devstore
- generate-pfx

api-cart:
image: desenvolvedorio/devstore-api-cart:latest
container_name: devstore-api-cart
build:
context: ../src
dockerfile: ./services/DevStore.ShoppingCart.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5201;http://+5202
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- api-identity
- database-devstore
- generate-pfx

api-catalog:
image: desenvolvedorio/devstore-api-catalog:latest
container_name: devstore-api-catalog
build:
context: ../src
dockerfile: ./services/DevStore.Catalog.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5301;http://+5302
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- database-devstore
- generate-pfx

api-customers:
image: desenvolvedorio/devstore-api-customers:latest
container_name: devstore-api-customers
build:
context: ../src
dockerfile: ./services/DevStore.Customers.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5401;http://+5402
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- api-identity
- database-devstore
- generate-pfx

api-bff-checkout:
image: desenvolvedorio/devstore-api-bff-checkout:latest
container_name: devstore-api-bff-checkout
build:
context: ../src
dockerfile: ./api-gateways/DevStore.Bff.Checkout/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5501;http://+5502
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- api-identity
- api-cart
- api-billing
- api-order
- generate-pfx

api-billing:
image: desenvolvedorio/devstore-api-billing:latest
container_name: devstore-api-billing
build:
context: ../src
dockerfile: ./services/DevStore.Billing.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5601;http://+5602
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSBilling;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- api-identity
- api-order
- database-devstore
- generate-pfx

api-order:
image: desenvolvedorio/devstore-api-order:latest
container_name: devstore-api-order
build:
context: ../src
dockerfile: ./services/DevStore.Orders.API/Dockerfile
restart: always
environment:
ASPNETCORE_ENVIRONMENT: Docker
ASPNETCORE_URLS: https://+:5701;http://+5702
ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe
ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx
CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- devstore-rabbit
- database-devstore
- api-identity
- generate-pfx

devstore-server:
image: desenvolvedorio/devstore-server:latest
container_name: devstore-server
build:
context: ./
dockerfile: ./nginx/Dockerfile
restart: always
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
ports:
- "7500:80"
- "7501:443"
depends_on:
- web-mvc

volumes:
dpkeys:

0 comments on commit cad806b

Please sign in to comment.