forked from net-daemon/netdaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
68 lines (55 loc) · 1.62 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Build the NetDaemon Admin with build container
FROM ludeeus/container:frontend as builder
RUN \
apk add make \
\
&& git clone https://github.com/net-daemon/admin.git /admin \
&& cd /admin \
&& git checkout tags/1.3.4 \
&& make deploy \
\
&& rm -fr /var/lib/apt/lists/* \
&& rm -fr /tmp/* /var/{cache,log}/*
# Pre-build .NET NetDaemon core project
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-1-buster-slim-amd64 as netbuilder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM"
RUN echo "building for $TARGETPLATFORM"
RUN export TARGETPLATFORM=$TARGETPLATFORM
# Copy the source to docker container
COPY ./src /usr/src
RUN dotnet publish /usr/src/Service/Service.csproj -o "/daemon"
# Final stage, create the runtime container
FROM mcr.microsoft.com/dotnet/sdk:5.0
# Install S6 and the Admin site
RUN apt update && apt install -y \
nodejs \
yarn \
jq \
make
COPY ./Docker/rootfs/etc /etc
COPY ./Docker/s6.sh /s6.sh
RUN chmod 700 /s6.sh
RUN /s6.sh
# COPY admin
COPY --from=builder /admin /admin
COPY --from=netbuilder /daemon /daemon
# NETDAEMON__WARN_IF_CUSTOM_APP_SOURCE=
# Set default values of NetDaemon env
ENV \
S6_KEEP_ENV=1 \
DOTNET_NOLOGO=true \
DOTNET_CLI_TELEMETRY_OPTOUT=true \
HASSCLIENT_MSGLOGLEVEL=Default \
HOMEASSISTANT__HOST=localhost \
HOMEASSISTANT__PORT=8123 \
HOMEASSISTANT__TOKEN=NOT_SET \
NETDAEMON__APPSOURCE=/data \
NETDAEMON__ADMIN=true \
ASPNETCORE_URLS=http://+:5000
LABEL \
io.hass.version="VERSION" \
io.hass.type="addon" \
io.hass.arch="armhf|aarch64|amd64"
ENTRYPOINT ["/init"]