Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Assignment2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bad
Assignment2
Compare revisions
074a6e32b010fdd33557a4e0ff1d0b9a74a038db to 0262f5bb1ef57b5b813ed1bb30da858ef57b2b54
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
bad1/assignment2
Select target project
No results found
0262f5bb1ef57b5b813ed1bb30da858ef57b2b54
Select Git revision
Swap
Target
bad1/assignment2
Select target project
bad1/assignment2
1 result
074a6e32b010fdd33557a4e0ff1d0b9a74a038db
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (4)
derp
· 464a501e
Hindubedu
authored
1 week ago
464a501e
dockerfile to launch logging
· b8aa8ca7
Hindubedu
authored
1 week ago
b8aa8ca7
deploy in production, dotnet run in dev
· c8ed53cb
Hindubedu
authored
1 week ago
c8ed53cb
Merge branch 'main' of
https://gitlab.au.dk/bad1/assignment2
· 0262f5bb
Hindubedu
authored
1 week ago
0262f5bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+18
-2
18 additions, 2 deletions
README.md
appsettings.Development.json
+22
-1
22 additions, 1 deletion
appsettings.Development.json
appsettings.json
+1
-1
1 addition, 1 deletion
appsettings.json
docker-compose.yaml
+17
-4
17 additions, 4 deletions
docker-compose.yaml
with
58 additions
and
8 deletions
README.md
View file @
0262f5bb
...
...
@@ -15,9 +15,25 @@ dotnet ef database update
add seed data to seeder (optional)
To setup the dockerfile:
docker-compose up
Local development:
For the MongoDB
If you have no container run this in bash or your fav terminal:
docker run -d --name mongodb
\
-p 27017:27017
\
-e MONGO_INITDB_DATABASE=AssignmentLoggingDB
\
mongo
this profile has no user / pass so it fits the connstring in appsettings.
Then run a get experience query and the db should appear (see compass or other app)
Force reset db
dotnet ef database drop --force
dotnet ef database update
Docker deploy:
To setup the dockerfile:
docker-compose down -v
docker-compose up -d --build
This diff is collapsed.
Click to expand it.
appsettings.Development.json
View file @
0262f5bb
{
"Serilog"
:
{
"MinimumLevel"
:
{
"Default"
:
"Debug"
,
"Override"
:
{
"Microsoft"
:
"Warning"
,
"System"
:
"Warning"
}
},
"WriteTo"
:
[
{
"Name"
:
"MongoDBBson"
,
"Args"
:
{
"databaseUrl"
:
"mongodb://localhost:27017/AssignmentLoggingDB?appName=MongoDB+Compass&directConnection=true&serverSelectionTimeoutMS=2000"
,
"collectionName"
:
"logs"
,
"cappedMaxSizeMb"
:
"50"
,
"cappedMaxDocuments"
:
"1000"
}
}
],
"Enrich"
:
[
"FromLogContext"
]
},
"AllowedHosts"
:
"*"
}
This diff is collapsed.
Click to expand it.
appsettings.json
View file @
0262f5bb
...
...
@@ -16,7 +16,7 @@
{
"Name"
:
"MongoDBBson"
,
"Args"
:
{
"databaseUrl"
:
"mongodb://
localhost
:27017/AssignmentLoggingDB?appName=MongoDB+Compass&directConnection=true&serverSelectionTimeoutMS=2000"
,
"databaseUrl"
:
"mongodb://
mongo
:27017/AssignmentLoggingDB?appName=MongoDB+Compass&directConnection=true&serverSelectionTimeoutMS=2000"
,
"collectionName"
:
"logs"
,
"cappedMaxSizeMb"
:
"50"
,
"cappedMaxDocuments"
:
"1000"
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yaml
View file @
0262f5bb
# Please refer https://aka.ms/HTTPSinContainer on how to setup an https developer certificate for your ASP.NET Core service.
version
:
'
3.8'
services
:
...
...
@@ -7,6 +5,7 @@ services:
image
:
api
depends_on
:
-
db-assignment2
-
mongo
restart
:
always
build
:
context
:
.
...
...
@@ -14,19 +13,33 @@ services:
ports
:
-
8888:8888
environment
:
ASPNETCORE_ENVIRONMENT
:
'
Development
'
ASPNETCORE_ENVIRONMENT
:
'
Production
'
DATABASE_CONNECTION_STRING
:
'
Server=db-assignment2;Database=master;User=sa;Password=lukasIsaNoob!;TrustServerCertificate=True'
MONGO_CONNECTION_STRING
:
'
mongodb://mongo:27017/AssignmentLoggingDB?appName=MongoDB+Compass&directConnection=true&serverSelectionTimeoutMS=2000'
volumes
:
-
~/.vsdbg:/remote_debugger:rw
db-assignment2
:
image
:
mcr.microsoft.com/mssql/server
image
:
mcr.microsoft.com/mssql/server
:2019-latest
user
:
root
volumes
:
-
api:/var/opt/mssql/data
environment
:
SA_PASSWORD
:
"
lukasIsaNoob!"
ACCEPT_EULA
:
"
Y"
mongo
:
image
:
mongo
restart
:
always
ports
:
-
27017:27017
volumes
:
-
mongo-data:/data/db
environment
:
MONGO_INITDB_DATABASE
:
AssignmentLoggingDB
volumes
:
api
:
name
:
db-assignment2
mongo-data
:
name
:
mongo-data
This diff is collapsed.
Click to expand it.