Skip to content
Snippets Groups Projects
Commit c8ed53cb authored by Hindubedu's avatar Hindubedu
Browse files

deploy in production, dotnet run in dev

parent b8aa8ca7
No related branches found
No related tags found
No related merge requests found
......@@ -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
{
"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": "*"
}
......@@ -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"
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment