Posted 22 January 2021, 3:48 am EST
Hello Dmitry!
Thanks for the answer. Its work!
Volume ```
- /usr/share/fonts:/usr/share/fonts
You into can also install ```
ttf-mscorefonts-installer
``` directly into container.
I suppose that the assembly should look like this, but I can't check it because I don't have a license (I'm considering your project)
Dockerfile
ARG PRODUCT_ID
ARG PRODUCT_SERIAL_KEY
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-alpine3.12-amd64 AS sdk
ENV PRODUCT_ID ${PRODUCT_ID}
ENV PRODUCT_SERIAL_KEY ${PRODUCT_SERIAL_KEY}
RUN apk --no-cache add --update nodejs npm
RUN dotnet tool install -g GrapeCity.LicenseManagerTool
ENV PATH=“$PATH:/root/.dotnet/tools”
WORKDIR /app
COPY WebDesigner_MVC_Core.sln WebDesigner_MVC_Core.csproj ./
RUN dotnet restore
COPY . .
RUN gclm “${PRODUCT_ID}” -a “${PRODUCT_SERIAL_KEY}”
RUN dotnet publish ./WebDesigner_MVC_Core.csproj
–runtime alpine-x64
–self-contained true
–configuration Release
/p:PublishTrimmed=true
/p:PublishSingleFile=true
–output ./out
|| gclm “${PRODUCT_ID}” -d “${PRODUCT_SERIAL_KEY}”
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0.2-alpine3.12-amd64 as runtime
do need nodeje in runtime?
RUN apk --no-cache add --update nodejs npm
RUN apk --no-cache add --update msttcorefonts-installer fontconfig &&
update-ms-fonts &&
fc-cache -f
COPY --from=sdk /app/out ./app
WORKDIR /app
ENTRYPOINT [“./WebDesigner_MVC_Core”]
CMD [“&”, “gclm”, “${PRODUCT_ID}”, “-d”, “${PRODUCT_SERIAL_KEY}”]
Or tye way.
docker-compose.yml
version: “3.9”
services:
reports:
image: webdesigner-mvc-core:1.0.0
restart: always
volumes:
- reports_resources:/app/resources
- reports_datasets:/app/datasets
- reports_templates:/app/templates
- reports_aspnet_keys:/root/.aspnet/DataProtection-Keys
# line below fix font error if fonts not installed into container
- /usr/share/fonts:/usr/share/fonts
ports:
- 80:80
- 443:443
volumes:
reports_resources:
driver: local
reports_datasets:
driver: local
reports_templates:
driver: local
reports_aspnet_keys:
driver: local
Run
dotnet tool install -g Microsoft.Tye --version “0.6.0-alpha.21070.5”
tye init
tye build
for debian
apt install ttf-mscorefonts-installer -y
docker-compose up -d
Thanks!