Languages used: C#
Web framework: .NET 7
To run this project, do the following:
Download .NET 7 SDK here - https://dotnet.microsoft.com/en-us/download/dotnet/7.0
Run the installer and in the terminal run:
dotnet --version
Output should show the dotnet version installed
Within VS code terminal, run the following commands:
Build the app:
dotnet build
Install certs required for the app to run:
dotnet dev-certs https --trust
NB: After running this command, reopen your browser
Run the app:
dotnet run
Access the application on this URL: https://localhost:7208/
click on a file and name it dockerfile configure the dockerfile in the following way
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app
COPY *.csproj ./ RUN dotnet restore
COPY . ./
RUN dotnet ef database update
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as runtime
WORKDIR /app
COPY --from=build-env /app/Data.db .
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "AmonyCoffeeMIS.dll"]
docker build -t AmonyCoffeeMI .
docker run -d -p 8080:80 AmonyCoffeeMI
8080 is where you can access the docker container . you can also decide on using another route eg 5000
in this case we are using sqlite.
docker pull keinos/sqlite3
docker run -d --name sqlite-container -v /path/to/database:/db keinos/sqlite3
docker exec -it sqlite-container sqlite3 /db/mydatabase.db
docker network create my-network
docker run -d -p 8080:80 --network my-network --name AmonyCoffeeMI AmonyCoffeeMI
docker run -d --network my-network --name keinos/sqlite3 keinos/sqlite3
version: '3'
services: AmonyCoffeeMI: image: AmonyCoffeeMI ports: - "8080:80" networks: - my-network
keinos/sqlite3: image: keinos/sqlite3 networks: - my-network
networks: my-network:
docker-compose up