-
Notifications
You must be signed in to change notification settings - Fork 189
/
Dockerfile
49 lines (37 loc) · 1.95 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# escape=`
# see https://discourse.mcneel.com/t/docker-support/89322 for troubleshooting
# NOTE: use 'process' isolation to build image (otherwise rhino fails to install)
### builder image
FROM mcr.microsoft.com/dotnet/sdk:5.0 as builder
# copy everything, restore nuget packages and build app
COPY src/ ./src/
RUN dotnet build -c Release src/compute.sln
### main image
# tag must match windows host for build (and run, if running with process isolation)
# e.g. 1903 for Windows 10 version 1903 host
FROM mcr.microsoft.com/windows:1809
# install .net 4.8 if you're using the 1809 base image (see https://git.io/JUYio)
# comment this out for 1903 and newer
RUN curl -fSLo dotnet-framework-installer.exe https://download.visualstudio.microsoft.com/download/pr/7afca223-55d2-470a-8edc-6a1739ae3252/abd170b4b0ec15ad0222a809b761a036/ndp48-x86-x64-allos-enu.exe `
&& .\dotnet-framework-installer.exe /q `
&& del .\dotnet-framework-installer.exe `
&& powershell Remove-Item -Force -Recurse ${Env:TEMP}\*
# install rhino (with “-package -quiet” args)
# NOTE: edit this if you use a different version of rhino!
# the url below will always redirect to the latest rhino 7 (email required)
# https://www.rhino3d.com/download/rhino-for-windows/7/latest/direct?email=EMAIL
RUN curl -fSLo rhino_installer.exe https://files.mcneel.com/dujour/exe/20210319/rhino_en-us_7.4.21078.01001.exe `
&& .\rhino_installer.exe -package -quiet `
&& del .\rhino_installer.exe
# (optional) use the package manager to install plug-ins
# RUN ""C:\Program Files\Rhino 7\System\Yak.exe"" install jswan
# copy compute app to image
COPY --from=builder ["/src/bin/Release/compute.geometry", "/app"]
WORKDIR /app
# bind compute.geometry to port 80
ENV RHINO_COMPUTE_URLS="http://+:80"
EXPOSE 80
# uncomment to build core-hour billing credentials into image (not recommended)
# see https://developer.rhino3d.com/guides/compute/core-hour-billing/
# ENV RHINO_TOKEN="TOKEN"
CMD ["compute.geometry.exe"]