Skip to content

Commit d9834b4

Browse files
committed
optimize docker build
1 parent b4c52b0 commit d9834b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ RUN dotnet build -c Release \
2222
&& cd src/SimplCommerce.WebHost \
2323
&& dotnet build -c Release \
2424
&& dotnet publish -c Release -o out
25+
26+
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
2527

2628
# remove BOM for psql
2729
RUN sed -i -e '1s/^\xEF\xBB\xBF//' /app/src/SimplCommerce.WebHost/dbscript.sql
@@ -41,8 +43,6 @@ WORKDIR /app
4143
COPY --from=build-env /app/src/SimplCommerce.WebHost/out ./
4244
COPY --from=build-env /app/src/SimplCommerce.WebHost/dbscript.sql ./
4345

44-
RUN curl -SL "https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so" --output ./libwkhtmltox.so
45-
4646
COPY --from=build-env /app/docker-entrypoint.sh /
4747
RUN chmod 755 /docker-entrypoint.sh
4848

Dockerfile-sqlite

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN dotnet build -c Release \
2323
&& cd src/SimplCommerce.WebHost \
2424
&& dotnet build -c Release \
2525
&& dotnet publish -c Release -o out
26+
27+
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
2628

2729
FROM mcr.microsoft.com/dotnet/aspnet:5.0
2830

@@ -34,6 +36,4 @@ WORKDIR /app
3436
COPY --from=build-env /app/src/SimplCommerce.WebHost/out ./
3537
COPY --from=build-env /app/src/SimplCommerce.WebHost/simplcommerce.db ./
3638

37-
RUN curl -SL "https://github.com/rdvojmoc/DinkToPdf/raw/v1.0.8/v0.12.4/64%20bit/libwkhtmltox.so" --output ./libwkhtmltox.so
38-
3939
ENTRYPOINT ["dotnet", "SimplCommerce.WebHost.dll"]

0 commit comments

Comments
 (0)