I'm following https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-2017 to config and run standalone sqlserver container in macos with persistent data successfully. Now I want to create a docker-compose file which contains 2 things:
- Web
- Database (will copy bak file from a host into the container and restore)
How do I achieve (2)?
My docker-compose file:
version: "3"
services:
web:
build:
context: ./webapi
dockerfile: Dockerfile
ports:
- "4010:80"
environment:
- ASPNETCORE_ENVIRONMENT=Development
depends_on:
- db
db:
image: "mcr.microsoft.com/mssql/server:2017-latest"
ports:
- "4009:1433"
volumes:
- "sqlvolume:/var/opt/mssql"
environment:
SA_PASSWORD: "<password>"
ACCEPT_EULA: "Y"
redis:
image: "redis:alpine"
volumes:
sqlvolume: