Skip to content

Commit

Permalink
fix: Docker-compose improvemements
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoPires committed Apr 19, 2022
1 parent 6f68534 commit 7462399
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 73 deletions.
68 changes: 40 additions & 28 deletions docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ services:
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
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-identity;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand All @@ -93,10 +95,12 @@ services:
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
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-cart;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand All @@ -122,10 +126,12 @@ services:
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
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-catalog;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand All @@ -150,10 +156,12 @@ services:
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
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-customers;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand All @@ -170,10 +178,10 @@ services:
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
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:
Expand Down Expand Up @@ -202,10 +210,12 @@ services:
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
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-billing;Database=DSBilling;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand All @@ -232,10 +242,12 @@ services:
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
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-order;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
Expand Down
171 changes: 126 additions & 45 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ services:
container_name: devstore-rabbit
environment:
RABBITMQ_DEFAULT_USER: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"
RABBITMQ_DEFAULT_PASS: "devstore"

sql-server:
image: desenvolvedorio/devstore-sql-server:latest
container_name: devstore-sql-server
environment:
SA_PASSWORD: "MyDB@123"
ACCEPT_EULA: "Y"
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)"
web-mvc:
image: desenvolvedorio/devstore-web-mvc-ecommerce:latest
container_name: devstore-web-mvc-ecommerce
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_ENVIRONMENT=Docker
- ASPNETCORE_URLS=http://*:5001
- LC_ALL=en_US.UTF-8
- LANG=en_US.UTF-8
Expand All @@ -33,78 +40,127 @@ services:
- api-identity
- api-customers
- api-bff-checkout
- generate-pfx

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

api-identity:
image: desenvolvedorio/devstore-api-identity:latest
container_name: devstore-api-identity
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5101;http://+5102
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-identity;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- sql-server
- database-identity
- generate-pfx

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

api-cart:
image: desenvolvedorio/devstore-api-cart:latest
container_name: devstore-api-cart
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5201;http://+5202
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-cart;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- api-identity
- sql-server
- database-cart
- generate-pfx

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

api-catalog:
image: desenvolvedorio/devstore-api-catalog:latest
container_name: devstore-api-catalog
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5301;http://+5302
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-catalog;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- sql-server
- database-catalog
- generate-pfx

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

api-customers:
image: desenvolvedorio/devstore-api-customers:latest
container_name: devstore-api-customers
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5401;http://+5402
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-customers;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- api-identity
- sql-server
- database-customers
- generate-pfx

api-bff-checkout:
image: desenvolvedorio/devstore-api-bff-checkout:latest
container_name: devstore-api-bff-checkout
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5501;http://+5502
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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:
Expand All @@ -113,47 +169,72 @@ services:
- api-cart
- api-billing
- api-order
- generate-pfx

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

api-billing:
image: desenvolvedorio/devstore-api-billing:latest
container_name: devstore-api-billing
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5601;http://+5602
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-billing;Database=DSBilling;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- api-identity
- api-order
- sql-server
- database-billing
- generate-pfx

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

api-order:
image: desenvolvedorio/devstore-api-order:latest
container_name: devstore-api-order
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=https://+:5701;http://+5702
- ASPNETCORE_Kestrel__Certificates__Default__Password=nerdstore
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/nerdstore-certificate.pfx
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-order;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123"
AppSettings__DatabaseType: SqlServer
volumes:
- ./certs:/https:ro
depends_on:
- rabbitmq
- sql-server
- api-identity
- database-order
- api-identity
- generate-pfx

devstore-server:
image: desenvolvedorio/devstore-server:latest
container_name: devstore-server
restart: always
ports:
- "80:80"
- "443:443"
- "7500:80"
- "7501:443"
depends_on:
- web-mvc

Expand Down

0 comments on commit 7462399

Please sign in to comment.