generated from Tieske/project.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): add docker files and setup
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker build --no-cache --progress plain --tag tieske/homie-zipato:dev . | ||
# docker image push tieske/homie-zipato:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM akorn/luarocks:lua5.1-alpine as build | ||
|
||
RUN apk add \ | ||
gcc \ | ||
git \ | ||
libc-dev \ | ||
make | ||
|
||
# install dependencies separately to not have --dev versions for them as well | ||
# RUN luarocks install copas \ | ||
# && luarocks install luasec \ | ||
# && luarocks install penlight \ | ||
# && luarocks install Tieske/luamqtt --dev \ | ||
# && luarocks install homie --dev \ | ||
# && luarocks install luabitop | ||
|
||
# copy the local repo contents and build it | ||
COPY ./ /tmp/homie-millheat | ||
WORKDIR /tmp/homie-millheat | ||
RUN luarocks make | ||
|
||
# collect cli scripts; the ones that contain "LUAROCKS_SYSCONFDIR" are Lua ones | ||
RUN mkdir /luarocksbin \ | ||
&& grep -rl LUAROCKS_SYSCONFDIR /usr/local/bin | \ | ||
while IFS= read -r filename; do \ | ||
cp "$filename" /luarocksbin/; \ | ||
done | ||
|
||
|
||
|
||
FROM akorn/lua:5.1-alpine | ||
|
||
ENV HOMIE_LOG_LOGLEVEL "debug" | ||
|
||
# copy luarocks tree and data over | ||
COPY --from=build /luarocksbin/* /usr/local/bin/ | ||
COPY --from=build /usr/local/lib/lua /usr/local/lib/lua | ||
COPY --from=build /usr/local/share/lua /usr/local/share/lua | ||
COPY --from=build /usr/local/lib/luarocks /usr/local/lib/luarocks | ||
|
||
CMD ["homie-zipato"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# export HOMIE_LOG_LOGGER="rsyslog" | ||
export HOMIE_LOG_LOGLEVEL="debug" | ||
# export HOMIE_LOG_LOGPATTERN="%message (%source)" | ||
# export HOMIE_LOG_RFC="rfc5424" | ||
# export HOMIE_LOG_MAXSIZE="8000" | ||
# export HOMIE_LOG_HOSTNAME="synology.local" | ||
# export HOMIE_LOG_PORT="8514" | ||
# export HOMIE_LOG_PROTOCOL="tcp" | ||
# export HOMIE_LOG_IDENT="homiemillheat" | ||
|
||
|
||
# LUA_PATH="./src/?/init.lua;./src/?.lua;$LUA_PATH" | ||
# lua bin/homie-zipato.lua | ||
|
||
docker run -it --rm \ | ||
-e HOMIE_LOG_LOGGER \ | ||
-e HOMIE_LOG_LOGLEVEL \ | ||
-e HOMIE_LOG_LOGPATTERN \ | ||
-e HOMIE_LOG_RFC \ | ||
-e HOMIE_LOG_MAXSIZE \ | ||
-e HOMIE_LOG_HOSTNAME \ | ||
-e HOMIE_LOG_PORT \ | ||
-e HOMIE_LOG_PROTOCOL \ | ||
-e HOMIE_LOG_IDENT \ | ||
tieske/homie-zipato:dev |