Hello ABP.IO Support Team,
We are working with ABP.IO 8.3.1 in a microservices setup using:
- Angular (frontend)
- .NET 8 (backend microservices)
- PostgreSQL + EF Core
- Redis
We have WSL2 (Ubuntu) installed and are able to build container images for our services. However, we are facing issues running them properly with localhost access (e.g., API Gateway, IdentityServer, Angular UI).
Could you please guide us with:
- Downloading the correct template from ABP.IO for our use case.
- Recommended Dockerfile/Docker Compose setup for Angular + .NET + PostgreSQL + Redis in ABP.IO.
- Correct way to configure environment variables, connection strings, and networking so services can communicate properly in containers.
- Any best practices for Dockerizing ABP.IO microservices.
Our main blocker right now is running the containers and accessing them on localhost through WSL2. We don't have Docker desktop for now.
Thanks in advance for your help!
- Exception message and full stack trace:
- Steps to reproduce the issue:
1 Answer(s)
-
0
- To get started with ABP.IO microservices for your stack, use the official Microservice Startup Template. Download it with the ABP CLI:
abp new Acme.BookStore -t microservice -u angular --database-provider postgresql
This template includes .NET 8, Angular, PostgreSQL, Redis, and Docker support.
- The template provides sample Dockerfiles and a
docker-compose.yml
for all services (API Gateway, IdentityServer, microservices, Angular UI, PostgreSQL, Redis). After generating the solution, check the/docker
folder and rootdocker-compose.yml
. You can run all services with:
docker compose up --build
Make sure your
docker-compose.yml
exposes ports for API Gateway, IdentityServer, and Angular UI (e.g., 44300, 44301, 4200).- Environment variables and connection strings are managed in
docker-compose.override.yml
and each service’s Dockerfile. For PostgreSQL and Redis, use service names as hostnames (e.g.,Host=postgres;
for PostgreSQL,Configuration=redis:6379
for Redis). ABP microservice templates use environment variables likeConnectionStrings__Default
andRedis__Configuration
for configuration. Example:
environment: - ConnectionStrings__Default=Host=postgres;Port=5432;Database=abp;User Id=postgres;Password=yourpassword - Redis__Configuration=redis:6379
All containers are on the same Docker network, so use service names (not
localhost
) for inter-service communication.- Best practices:
- Use the provided template and Docker Compose files as a base.
- Always use Docker service names for connection strings.
- Expose only necessary ports to your host.
- For WSL2, access services via
localhost:<exposed-port>
. - Use
.env
files for secrets and environment-specific overrides. - For development, you can mount code as volumes for hot reload.
If you have issues accessing services on
localhost
, ensure ports are published indocker-compose.yml
and not blocked by firewalls. For WSL2, Docker’s networking is compatible withlocalhost
access.Sources:
- https://abp.io/docs/en/abp/latest/Startup-Templates/Microservice
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.