Skip to content

Commit 40d2cc5

Browse files
committed
refactor appsettings
1 parent 9ee9ab9 commit 40d2cc5

File tree

4 files changed

+45
-14
lines changed

4 files changed

+45
-14
lines changed

docker-compose.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@
22

33
services:
44
api:
5-
image: skit
6-
build:
7-
context: .
8-
dockerfile: Dockerfile
5+
image: skitskni/api:latest
96
depends_on:
107
- db
118
ports:
129
- '5000:80'
10+
env_file:
11+
- .env
1312

1413
db:
1514
image: postgres
1615
ports:
1716
- '6000:5432'
18-
environment:
19-
POSTGRES_DB: skit-database
20-
POSTGRES_USER: skit-user
21-
POSTGRES_PASSWORD: 1qazXSW@
17+
environment:
18+
POSTGRES_DB: ${POSTGRES_DB}
19+
POSTGRES_USER: ${POSTGRES_USER}
20+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
2221
volumes:
2322
- postgres-data:/var/lib/postgresql/data
2423
depends_on:
@@ -32,8 +31,8 @@ services:
3231
volumes:
3332
- minio_data:/data
3433
environment:
35-
- MINIO_ROOT_USER=admin
36-
- MINIO_ROOT_PASSWORD=1qazXSW@
34+
- MINIO_ROOT_USER=${S3Service__AccessKey}
35+
- MINIO_ROOT_PASSWORD=${S3Service__SecretKey}
3736
command: server --console-address ":9001" --address ":9000" /data
3837

3938
volumes:

skit.API/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
var app = builder.Build();
4040

4141
// Configure the HTTP request pipeline.
42-
if (app.Environment.IsDevelopment())
43-
{
42+
//if (app.Environment.IsDevelopment())
43+
//{
4444
app.UseSwagger();
4545
app.UseSwaggerUI();
46-
}
46+
//}
4747

4848
app.UseHttpsRedirection();
4949
app.UseRouting();

skit.API/appsettings.json

+32-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,36 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"ApplicationConfig": {
9+
"APIUrl": "",
10+
"ApplicationUrl": ""
11+
},
12+
"ConnectionStrings": {
13+
"DatabaseConnection": ""
14+
},
15+
"Authentication": {
16+
"JwtKey": "",
17+
"JwtIssuer": "",
18+
"Expires": "",
19+
"RefreshTokenTTL": ""
20+
},
21+
"SMTP": {
22+
"SmtpUrl": "",
23+
"SmtpPort": "",
24+
"SmtpLogin": "",
25+
"SmtpPassword": "",
26+
"SmtpSenderMail": "",
27+
"SmtpSenderName": ""
28+
},
29+
"S3Service": {
30+
"S3Url": "",
31+
"AccessKey": "",
32+
"SecretKey": "",
33+
"BucketName": "",
34+
"UrlExpires": ""
35+
},
36+
"GoogleAuth": {
37+
"ClientId": "",
38+
"ClientSecret": ""
39+
}
940
}

skitBackend.sln

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2626
docker-compose.yml = docker-compose.yml
2727
Dockerfile = Dockerfile
2828
.dockerignore = .dockerignore
29+
.env = .env
2930
EndProjectSection
3031
EndProject
3132
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skit.UnitTests", "skit.UnitTests\skit.UnitTests.csproj", "{CC7C66BF-EB32-4418-B791-717CE566E822}"

0 commit comments

Comments
 (0)