File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ services:
77 dockerfile : Dockerfile
88 environment :
99 - ASPNETCORE_ENVIRONMENT=Production
10- # Note: Consider using ${SA_PASSWORD} for better security instead of hardcoding
11- - ConnectionStrings__DefaultConnection=Server=gym-db;Database=GymMasterDb;User Id=sa;Password=Gymdb2025@2025 ;TrustServerCertificate=True;
10+ # Using variable from .env for DB password is safer
11+ - ConnectionStrings__DefaultConnection=Server=gym-db;Database=GymMasterDb;User Id=sa;Password=${SA_PASSWORD} ;TrustServerCertificate=True;
1212 - JWT__Secret=${JWT_SECRET}
1313 - JWT__Issuer=${DOMAIN_NAME}
1414 - JWT__Audience=${DOMAIN_NAME}
@@ -20,25 +20,26 @@ services:
2020 - gym-db
2121 restart : always
2222 networks :
23- - proxy_net # connects to the internet (via Proxy Manager)
24- - internal_net # connects to the database
23+ - proxy_net
24+ - internal_net
2525
2626 # 2. SQL Server Database
2727 gym-db :
2828 image : mcr.microsoft.com/mssql/server:2022-latest
2929 environment :
3030 - ACCEPT_EULA=Y
31- - MSSQL_SA_PASSWORD=Gymdb2025@2025
31+ - MSSQL_SA_PASSWORD=${SA_PASSWORD}
3232 volumes :
3333 - sql_data:/var/opt/mssql
3434 restart : always
3535 networks :
36- - internal_net # Only accessible by the API, safe from the internet!
37-
38- # REMOVED: The manual 'nginx' service.
39- # Nginx Proxy Manager is already running separately and handles Port 80.
36+ - internal_net
4037
38+ # 3. Network & Volume Definitions
4139networks :
4240 proxy_net :
43- external : true # This network must already exist (docker network create proxy_net)
44- internal_net : # This creates a private link between API and DB
41+ external : true
42+ internal_net :
43+
44+ volumes :
45+ sql_data :
You can’t perform that action at this time.
0 commit comments