Skip to content

Starting point for a web application with authorization and authentification set up.

Notifications You must be signed in to change notification settings

dornakv/LoginNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disclaimer: During the creation of this project code, LLM was used.

Goal

This project will be a starting point for a web application with authorization and authentification set up. Backend will be in dotnet, backed by a Postgres db.

We want to need minimal setup on the developer machine when working using this project. Therefore, everything will be ready to build and run using docker images.

Running

Build and run dev:

docker-compose -f docker/docker-compose.dev.yml up --build

Build and run prod:

docker-compose -f docker/docker-compose.prod.yml up --build

Dotnet tools

To run tools, like generating migrations, build

docker build --target development-tools -f docker/dockerfile -t loginnet-dev-tools .

and run

docker run --rm -v "$PWD/src/server:/app" -v "/app/obj" -w "/app" loginnet-dev-tools dotnet ...

Setup

Backend template generation using docker image:

docker run --rm \
    -v "$PWD:/workdir" \
    -w "/workdir" \
    mcr.microsoft.com/dotnet/sdk:10.0 \
    dotnet new web -o server

Runs dotnet new web -o server using the dotnet-sdk docker container inside /workdir directory. Current $PWD is mapped to the /workdir.

Explanations

There is no need for launchSettings.json to set port and everything. When run through docker, it uses values set by env variables.

The app does not take care of tls and does not expose https port. This should be a job of a reverse proxy.

We ignore ./src/server/bin and ./src/server/obj in docker build (do not copy from build context to the image). Some tools (vscode+omnisharp) create these automatically even when we do not build localy. However, during the build of the docker, we want the dotnet to create its own. Also, during dev, when we map ./src, we want to avoid mapping these, so not to mix these.

TODO

  • In dev, we mount the /src/server so that the container works with the files on our filesystem, this allows us to update files in real time
  • We need to find a way to stop bin and obj from being synced with our filesystem. Ideally completely change their location in docker

About

Starting point for a web application with authorization and authentification set up.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages