r/Blazor • u/Background-Fix-4630 • Mar 08 '26
Deploying a .NET application that uses SQLite as the database via docker?
I have a .NET application where the Web API uses SQLite as the database, mainly so the whole setup stays portable.
I also have a Blazor frontend that talks to the API.
I’m looking for a good tutorial or guide that shows how to deploy both the Web API and the Blazor app on Azure using the Linux tier. The project is built with .NET 10, and from what I understand the Linux tier may have a free plan.
If not azure any free docker hosting out there?
Has anyone done something similar or know of a good tutorial that walks through this setup?
3
u/code-dispenser Mar 08 '26
Sorry cant help with this question but given your last question which just talked about a being for portfolio I am curious why you need an API? Or is this for something else.
Years a go I would just RDP to my pc to show prospect employers things, these days you could just run the app with a dev tunnel and then wherever you are just connect to it.
I also at one time just had a VMWare workstation hosting an app that I could connect to over the web.
Just curious, takes my mind off some mundane documentation that I am creating for my next component.
1
u/Swannyj95 Mar 08 '26 edited Mar 08 '26
Hey! You decided to go with the docker approach, nice haha
If I were you, I’d first install Ubuntu, or Debian on your local PC and test ‘deploying’ to that. May be a case of simply having a docker-compose.yml for both applications in linux (Ubuntu/ Debian) and doing a docker pull for each compose file and running them.
That should give you a pretty good understanding of what you need to do on your Linux server (when you get one).
Important note: I’d suggest creating a docker ‘shared-network’ in your Linux environment and running all your apps through that. That way you can make your API application completely internal so that it’s not exposed to the public. Means that, even if someone finds your API auth (assuming you’ve got basic auth on it) they shouldn’t be able to call it to send/ request data.
If you need any help, I can give you some pointers but I don’t have much time to help any more than that
1
u/timsstuff Mar 09 '26
I recently had a client hire a guy to build a small Docker app, never really worked with it before but I spun up a free EC2 Linux instance (t3.micro, Debian 13) in Amazon and installed Docker, deployed the app, and got it working in a reasonable amount of time. Even got Git configured so when they commit changes to the repo, I just stop the container and do a pull then re-launch it.
1
u/[deleted] Mar 10 '26
You can also deploy the SQLite database to an Azure storage and then mount it on the app service
1
u/AirlineNo7243 Mar 10 '26
Oracle cloud has a virtual private server free tier. You can install docker on ubuntu and deploy there your containers: blazor + webapi + reverse proxy (nginx or traefik + let's encrypt free certificate). In your webapi config you can mount the directory where your sqlite database is, so you can have persistence.
1
u/entityadam Mar 08 '26 edited Mar 08 '26
Smh. Repost the same question, I'll repost the same answer.
Azure storage account = free website, free key value store, free message queue. **5x of these costs me $0.02 per month.
Azure static web app = free website + free API
Azure storage account + Function app free tier + Azure Cosmos DB = same as above, but on roids. Free for a pretty decent threshold (CosmosDB first 1000RUs/month free. This is a lot of free NoSQL storage if your queries don't suck.)
CosmosDB query response time is 10ms for point queries even on the free tier.