I have the following application structure:
- Web application -> Nuxt.js
- REST API -> .NET Core 2.2 (Output type: Console Application)
- Database -> MySQL
Each of them has a Dockerfile and is inside a container defined in a docker-compose file. I'm running them in Linux containers (using Docker Desktop - version 3.0.0 and Compose 1.27.4). I have a docker-compose file to run them locally, and a docker-compose.final.prod to be deployed. I'm using Hyper-V.
Then I have:
- WCF Server -> .NET Framework 4.7.2 (Output type: Class Library)
- WCF Client -> .NET Framework 4.6.1 (Output type: Class Library)
WCF Client consumes Web Services (SOAP) inside Dynamics Navision. The data stored in MySQL database is the same data that we get from Web Services in Dynamics Navision. WCF Client processes that data from Web Services, sends it to the WCF Server, and in turn it updates the Web application database (MySQL database). WCF Server is connected to the MySQL database.
Shortly, this WCF services updates the database with the data of the Web Services.
Dynamics Navision is only accessed by intranet (company network). It needs VPN to be accessed. That's why it was built with two WCF services: one service (client) inside the company to getting the data from Dynamics Navision and other service (server) inside the Docker to update the MySQL database.
These both WCF services are only working locally, which update the MySQL database locally, but they are not inside the Docker containers.
Once .NET Framework is only for Windows platform, I can't add these both WCF services to the Docker, because I'm using Linux containers. I tried to use Windows containers but it gives me an error on REST API on docker-compose build
:
ERROR: Service REST-API failed to build It was not possible to complete the requested operation due to a limitation of the virtual disk system. The virtual hard disk files must not be compressed or encrypted and must not be scattered.
I did research to workaround this error and I didn't get an appropriate solution. I think it's because of the Windows containers memory limitation. According to this answer, .NET Core and .NET Framework code occupies a lot of memory inside Windows containers, so I guess I need the containers inside Linux containers. It also recommends to convert .NET Framework to .NET Core. This site talks about a solution by using WSL-2, but I need this up and running with Hyper-V only.
The main objective of the WCF services is to update the MySQL database like a Backoffice. Whenever there's an update on Dynamics Navision, the user (administrator) clicks on a button on the Web application and it calls the WCF services to update the MySQL database.
I'm looking for a way to create only a service that consumes data from those Web Services and updates the database, using .NET Core (or even .NET Framework if it's possible to integrate it to Linux containers using Hyper-V). A different approach if necessary.
I did a lot of research and I'm thinking of creating a gRPC server that consumes the Web Services, then creating the gRPC client on the Web application. It allows me to have an independent service, but I don't know if it's a good approach, because I already have a REST API.
Other option is implement this feature in the REST API and consume the Web Services on the API, but I'm not quite sure.
What I did so far was converting WCF Server to gRPC using the extension Visual ReCode.
NOTE: I'm using Visual Studio 2019 -> Version 16.8.3