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
Commits
c8ed53cb
Commit
c8ed53cb
authored
1 week ago
by
Hindubedu
Browse files
Options
Downloads
Patches
Plain Diff
deploy in production, dotnet run in dev
parent
b8aa8ca7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+11
-7
11 additions, 7 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
+1
-1
1 addition, 1 deletion
docker-compose.yaml
with
35 additions
and
10 deletions
README.md
+
11
−
7
View file @
c8ed53cb
...
...
@@ -15,13 +15,7 @@ dotnet ef database update
add seed data to seeder (optional)
To setup the dockerfile:
docker-compose down -v
docker-compose up -d
Force reset db (not for docker)
dotnet ef database drop --force
dotnet ef database update
Local development:
For the MongoDB
If you have no container run this in bash or your fav terminal:
...
...
@@ -33,3 +27,13 @@ docker run -d --name mongodb \
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
+
22
−
1
View file @
c8ed53cb
{
"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
+
1
−
1
View file @
c8ed53cb
...
...
@@ -11,7 +11,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
+
1
−
1
View file @
c8ed53cb
...
...
@@ -13,7 +13,7 @@ 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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment