Created
June 29, 2024 15:39
-
-
Save HamidMolareza/0714e0f2d1946e2da5fb5c30effb84cf to your computer and use it in GitHub Desktop.
docker-compose template file for ASP + SqlServer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
api: | |
image: asp-api | |
build: | |
context: . | |
dockerfile: Dockerfile | |
environment: | |
- ASPNETCORE_ENVIRONMENT=Production | |
- ConnectionStrings__Default=Server=db,1433;Database=AspApi;User Id=sa;Password=thisIsMssql@Password;TrustServerCertificate=True; | |
ports: | |
- "8080:8080" | |
- "8081:8081" | |
depends_on: | |
- db | |
networks: | |
- internal | |
db: | |
image: mcr.microsoft.com/mssql/server | |
environment: | |
SA_PASSWORD: "thisIsMssql@Password" | |
ACCEPT_EULA: "Y" | |
volumes: | |
- sql_data:/var/opt/mssql | |
networks: | |
- internal | |
volumes: | |
sql_data: | |
networks: | |
internal: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment