{"id":15172738,"url":"https://github.com/fritzthecat9/dockerblazorwasmtest","last_synced_at":"2026-02-16T01:10:00.923Z","repository":{"id":236323344,"uuid":"792383512","full_name":"FritzTheCat9/DockerBlazorWASMTest","owner":"FritzTheCat9","description":"Deploy C# web API backend, Blazor WASM frontend, and Postgres database to Raspberry Pi with Docker","archived":false,"fork":false,"pushed_at":"2024-04-27T15:49:27.000Z","size":126,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T09:42:26.960Z","etag":null,"topics":["api","blazor","blazor-client","blazor-webassembly","c-sharp","csharp","docker","docker-compose","http","https","minimal-api","nginx","postgresql","postgresql-database","raspberry-pi","raspberry-pi-4","raspberry-pi4","wasm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FritzTheCat9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T14:58:31.000Z","updated_at":"2024-04-27T21:09:28.000Z","dependencies_parsed_at":"2024-11-07T19:44:07.795Z","dependency_job_id":"09ff4f5a-604d-43a4-8843-29285977a098","html_url":"https://github.com/FritzTheCat9/DockerBlazorWASMTest","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"1505f071257135eb595c278683fe482d3d7b1872"},"previous_names":["fritzthecat9/dockerblazorwasmtest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerBlazorWASMTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerBlazorWASMTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerBlazorWASMTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FritzTheCat9%2FDockerBlazorWASMTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FritzTheCat9","download_url":"https://codeload.github.com/FritzTheCat9/DockerBlazorWASMTest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239686074,"owners_count":19680448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blazor","blazor-client","blazor-webassembly","c-sharp","csharp","docker","docker-compose","http","https","minimal-api","nginx","postgresql","postgresql-database","raspberry-pi","raspberry-pi-4","raspberry-pi4","wasm"],"created_at":"2024-09-27T10:04:11.545Z","updated_at":"2025-09-20T10:51:40.980Z","avatar_url":"https://github.com/FritzTheCat9.png","language":"C#","readme":"# DockerBlazorWASMTest\nThis repository contains C# web API backend with database and Blazor WASM frontend served in docker-compose file.\n\n### Generate https certificate for Api:\n```\ncd %USERPROFILE%\ndotnet dev-certs https --clean\ndotnet dev-certs https -ep .aspnet\\https\\aspnetapp.pfx -p password\ndotnet dev-certs https --trust\n-ep - path to existing certificate file (.pfx) that you want to use for HTTPS development (existing PFX file)\n```\n### Generate https certificate for Blazor WASM (when generating certificate press ENTER):\n```\ncd %USERPROFILE%\\.aspnet\\https\nPress ENTER on any prompts after this command:\nopenssl req -newkey rsa:2048 -nodes -keyout private.key -out certificate.csr\nopenssl x509 -req -days 365 -in certificate.csr -signkey private.key -out certificate.crt\n```\n### Run application with one command (setup all docker containers with database, change environment variables depending on system You want to use):\n```\ncd C:\\Users\\bartl\\source\\repos\\DockerBlazorWASMTest\ndocker-compose --env-file linux.env up -d --build\ndocker-compose --env-file windows.env up -d --build\n--env-file - environment variables (other for different configuration / system)\n-d - detached mode (services in the background, without blocking the command prompt)\n--build - rebuild the docker images\n```\n### Created containers:\n- C# Web API http/https (swagger):\n```\nhttp://localhost:5000 (redirect to https 5001)\nhttps://localhost:5001\n```\n- Blazor WASM frontend http/https:\n```\nhttp://localhost:7000 (redirect to https 7001)\nhttps://localhost:7001\n```\n### Open the Blazor WASM frontend on https://localhost:7001, trust the website.\n### Docker compose push (push all containers to docker hub)\n```\ndocker-compose --env-file linux.env push\ndocker-compose --env-file windows.env push\n```\n### Copy files to Raspberry Pi (change \u003craspberrypi_ip\u003e to correct Raspberry Pi ip)\n- Copy \"docker-compose.yml\" file to Raspberry Pi (using scp)\n- Copy \"linux.env\" file to Raspberry Pi (using scp)\n```\nscp C:\\Users\\bartl\\source\\repos\\DockerBlazorWASMTest\\docker-compose.yml malinka@\u003craspberrypi_ip\u003e:/home/malinka/Desktop/\nscp C:\\Users\\bartl\\source\\repos\\DockerBlazorWASMTest\\linux.env malinka@\u003craspberrypi_ip\u003e:/home/malinka/Desktop/\n```\n##### IMPORTANT - COPY CERTIFICATE TO RASPBERRY PI!!! (use scp) -\u003e to: $HOME/.aspnet/https (change \u003craspberrypi_ip\u003e to correct Raspberry Pi ip)\n```\nscp C:\\Users\\bartl\\.aspnet\\https\\aspnetapp.pfx malinka@\u003craspberrypi_ip\u003e:/home/malinka/Desktop\nscp C:\\Users\\bartl\\.aspnet\\https\\private.key malinka@\u003craspberrypi_ip\u003e:/home/malinka/Desktop\nscp C:\\Users\\bartl\\.aspnet\\https\\certificate.crt malinka@\u003craspberrypi_ip\u003e:/home/malinka/Desktop\nssh malinka@\u003craspberrypi_ip\u003e\nsudo mv /home/malinka/Desktop/aspnetapp.pfx /home/malinka/.aspnet/https\nsudo mv /home/malinka/Desktop/private.key /home/malinka/.aspnet/https\nsudo mv /home/malinka/Desktop/certificate.crt /home/malinka/.aspnet/https\nls -la /home/malinka/.aspnet/https\n```\n### Pull and run Docker Compose on Rapberry Pi / Windows:\n```\ndocker-compose --env-file linux.env pull\ndocker-compose --env-file linux.env up -d\ndocker-compose --env-file windows.env pull\ndocker-compose --env-file windows.env up -d\n```\n### Check docker images and containers:\n```\ndocker images\ndocker ps -a\n```\n### Test Apis:\n```\ncurl http://localhost:5000/api\ncurl -k https://localhost:5001/api\ncurl http://localhost:7000/api\ncurl -k https://localhost:7001/api\n-k - ignore certificate check\n```\n### Helpers:\nUpdate ef core tools:\n```\ndotnet tool update --global dotnet-ef\n```\nRemember to change ***MIGRATION_NAME*** \n``` \ncd C:\\Users\\bartl\\source\\repos\\DockerBlazorWASMTest\\DockerBlazorWASMTest.Api\ndotnet ef migrations add MIGRATION_NAME -o ./Migrations --startup-project ../DockerBlazorWASMTest.Api\ndotnet ef migrations add Init -o ./Migrations --startup-project ../DockerBlazorWASMTest.Api\ndotnet ef database update\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritzthecat9%2Fdockerblazorwasmtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffritzthecat9%2Fdockerblazorwasmtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritzthecat9%2Fdockerblazorwasmtest/lists"}