5 Star 8 Fork 3

Gitee 极速下载/simplcommerce

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/simplcommerce/SimplCommerce
克隆/下载
Dockerfile-sqlite 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
Thien Nguyen Le Quynh 提交于 2021-01-19 05:57 . optimize docker build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
COPY . ./
RUN sed -i 's#<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />#<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0" />#' src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj
RUN sed -i 's/UseSqlServer/UseSqlite/' src/SimplCommerce.WebHost/Program.cs
RUN sed -i 's/UseSqlServer/UseSqlite/' src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs
RUN sed -i 's/"DefaultConnection": ".*"/"DefaultConnection": "Data Source=simplcommerce.db"/' src/SimplCommerce.WebHost/appsettings.json
RUN rm src/SimplCommerce.WebHost/Migrations/*
RUN dotnet tool install --global dotnet-ef --version 5.0.0
ENV PATH="${PATH}:/root/.dotnet/tools"
# ef core migrations run in debug, so we have to build in Debug for copying module correctly
RUN dotnet restore && dotnet build \
&& cd src/SimplCommerce.WebHost \
&& dotnet ef migrations add initialSchema \
&& dotnet ef database update
RUN dotnet build -c Release \
&& cd src/SimplCommerce.WebHost \
&& dotnet build -c Release \
&& dotnet publish -c Release -o out
RUN curl -SL "https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so" --output /app/src/SimplCommerce.WebHost/out/libwkhtmltox.so
FROM mcr.microsoft.com/dotnet/aspnet:5.0
RUN apt-get update \
&& apt-get install libgdiplus -y \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build-env /app/src/SimplCommerce.WebHost/out ./
COPY --from=build-env /app/src/SimplCommerce.WebHost/simplcommerce.db ./
ENTRYPOINT ["dotnet", "SimplCommerce.WebHost.dll"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/simplcommerce.git
git@gitee.com:mirrors/simplcommerce.git
mirrors
simplcommerce
simplcommerce
master

搜索帮助