Currently, the generated docker-compose.yml file for a tiered solution only has the 'web' service defined in it, but I'm more concerned about all the url settings needed to run ABP, such as the ones for oidc, etc
On which version did you come across this behavior? This problem should have been fixed on version 7.1.0-rc.
Here is the docker-compose.yml
file I've just generated for a tiered mvc project named Acme.BookStore on latest rc version 7.1.0-rc.3:
version: '3.7'
services:
bookstore-web:
image: acme/bookstore-web:latest
container_name: bookstore-web
hostname: bookstore-web
build:
context: ../../
dockerfile: src/Acme.BookStore.Web/Dockerfile.local
environment:
- ASPNETCORE_URLS=https://+:443;http://+:80;
- Kestrel__Certificates__Default__Path=/root/certificate/localhost.pfx
- Kestrel__Certificates__Default__Password=91f91912-5ab0-49df-8166-23377efaf3cc
- App__SelfUrl=https://localhost:44353
- AuthServer__RequireHttpsMetadata=false
- AuthServer__IsContainerizedOnLocalhost=true
- AuthServer__Authority=https://localhost:44334/
- RemoteServices__Default__BaseUrl=http://bookstore-api
- RemoteServices__AbpAccountPublic__BaseUrl=http://bookstore-authserver
- AuthServer__MetaAddress=http://bookstore-authserver
- Redis__Configuration=redis
ports:
- "44353:443"
depends_on:
- bookstore-api
restart: on-failure
volumes:
- ./certs:/root/certificate
networks:
- abp-network
bookstore-api:
image: acme/bookstore-api:latest
container_name: bookstore-api
hostname: bookstore-api
build:
context: ../../
dockerfile: src/Acme.BookStore.HttpApi.Host/Dockerfile.local
environment:
- ASPNETCORE_URLS=https://+:443;http://+:80;
- Kestrel__Certificates__Default__Path=/root/certificate/localhost.pfx
- Kestrel__Certificates__Default__Password=91f91912-5ab0-49df-8166-23377efaf3cc
- App__SelfUrl=https://localhost:44354
- App__HealthCheckUrl=http://bookstore-api/health-status
- AuthServer__RequireHttpsMetadata=false
- AuthServer__Authority=http://bookstore-authserver
- ConnectionStrings__Default=Data Source=sql-server;Initial Catalog=BookStore;User Id=sa;Password=myPassw0rd;MultipleActiveResultSets=true;TrustServerCertificate=True;
- Redis__Configuration=redis
ports:
- "44354:443"
depends_on:
sql-server:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
volumes:
- ./certs:/root/certificate
networks:
- abp-network
bookstore-authserver:
image: acme/bookstore-authserver:latest
container_name: bookstore-authserver
build:
context: ../../
dockerfile: src/Acme.BookStore.AuthServer/Dockerfile.local
environment:
- ASPNETCORE_URLS=https://+:443;http://+:80;
- App__SelfUrl=https://localhost:44334
- App__CorsOrigins=https://localhost:44353,https://localhost:44354
- AuthServer__RequireHttpsMetadata=false
- AuthServer__Authority=http://bookstore-authserver
- Kestrel__Certificates__Default__Path=/root/certificate/localhost.pfx
- Kestrel__Certificates__Default__Password=91f91912-5ab0-49df-8166-23377efaf3cc
- ConnectionStrings__Default=Data Source=sql-server;Initial Catalog=BookStore;User Id=sa;Password=myPassw0rd;MultipleActiveResultSets=true;TrustServerCertificate=True;
- Redis__Configuration=redis
ports:
- "44334:443"
depends_on:
sql-server:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
volumes:
- ./certs:/root/certificate
networks:
- abp-network
db-migrator:
image: acme/bookstore-db-migrator:latest
container_name: db-migrator
build:
context: ../../
dockerfile: src/BookStore.DbMigrator/Dockerfile.local
environment:
- OpenIddict__Applications__BookStore_Web__RootUrl=https://localhost:44353
- OpenIddict__Applications__BookStore_Swagger__RootUrl=https://localhost:44354
- ConnectionStrings__Default=Data Source=sql-server;Initial Catalog=BookStore;User Id=sa;Password=myPassw0rd;MultipleActiveResultSets=true;TrustServerCertificate=True;
depends_on:
sql-server:
condition: service_healthy
networks:
- abp-network
sql-server:
container_name: sql-server
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- "1434:1433"
environment:
SA_PASSWORD: "myPassw0rd"
ACCEPT_EULA: "Y"
volumes:
- sqldata:/var/opt/mssql
networks:
- abp-network
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S sql-server -U sa -P "myPassw0rd" -Q "SELECT 1" -b -o /dev/null
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
redis:
container_name: redis
image: redis:alpine
ports:
- "6379:6379"
networks:
- abp-network
healthcheck:
test: ["CMD", "redis-cli","ping"]
volumes:
sqldata:
name: bookstore_sqldata
networks:
abp-network:
name: bookstore-network
driver: bridge
You can try to use this and update as you see fit.
You can check https://github.com/abpframework/abp-samples/tree/master/StoredProcedureDemo
You can call migration after the application starts. In your blazor-server module you can override OnPostApplicationInitializationAsync
method:
public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<BookStoreDbMigrationService>() // Your applicationDbMigrationService
.MigrateAsync();
}
We're preparing to guide explaining how to run ABP application using docker-compose on localhost environment. Postgres is not supported currently.
You need to update the docker-compose.yml file and update the sql-server service with a postgres image and update the connectionstrings based on that.
Afterwards, please share the problems you come across.
Thank you. Since the "libs" folder is not included in the code by default when pushing to a Git repo, can anyone provide steps (YAML code) to restore the contents of the "libs" folder during an Azure DevOps build pipeline?
You can install abp tooling and use abp install-libs command in your pipeline.
It is not written on the stone :) I personally recommend removing from gitignore if you are using CI&CD pipeline.
You can check https://github.com/abpframework/abp/issues/8528
Hi,
There is still an open issue about gRPC support for Ocelot however It may not be supported at all. We have an internal issue about changing the gateway library and we will try to hasten our discussion for a solution about this subject.
Unfortunatelly we don't have a sample for the web or public-web application making a gRPC request through the gateway to a microservice. The gateway should have support for non-http protocol redirects. Maybe you can change ocelot to YARP and try it. There is a documentation about Proxying gRPC.
We have eShopOnAbp sample demonstrates it that you can check. BasketService making gRPC request to CatalogService.
Hi thedatacrew,
Can you update to version 7.1 preview and let us know if this problem still persist?
Did you also add https://eventstreamingpublicwebdev.azurewebsites.net to https://eventstreamingapidev.azurewebsites.net CORS origins?
Can you try removing .AllowCredentials();
and test again?