1. docker-compose 安装
python 2.7
pip
pip install docker-compose
常见问题:
解决方法:
pip install pypiwin32
2. docker-compose.yaml
docker-compose.yaml 文件如下:
version: ‘2.1‘
services:
db:
image: microsoft/mssql-server-windows-developer
environment:
sa_password: "Password1"
ACCEPT_EULA: "Y"
ports:
- "1433:1433" # REMARK: This is currently required, needs investigation
healthcheck:
test: [ "CMD", "sqlcmd", "-U", "sa", "-P", "Password1", "-Q", "select 1" ]
interval: 1s
retries: 20
web:
build:
context: .
dockerfile: Dockerfile.windows
environment:
- "Data:DefaultConnection:ConnectionString=Server=db,1433;Database=MusicStore;User Id=sa;Password=Password1;MultipleActiveResultSets=True"
depends_on:
db:
condition: service_healthy
ports:
- "5000:5000"
networks:
default:
external:
name: nat
参考地址:
https://github.com/friism/MusicStore
时间: 2024-10-08 02:38:59