-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.05 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
# ====================================
# ===== Build image for rtl_433 =====
# ====================================
FROM alpine AS builder-rtl433
RUN apk add --no-cache git rtl-sdr autoconf build-base cmake libtool librtlsdr-dev
RUN git clone https://github.com/merbanan/rtl_433.git && \
cd rtl_433 && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install
# ================================
# ===== efergyexporter image =====
# ================================
FROM node:alpine3.12
# set environment variables
ENV NODE_CONFIG_DIR /config
# set working directory
WORKDIR /app
# copy files
COPY root/ /
COPY --from=builder-rtl433 /usr/local/bin/rtl_433 /app/
# install packages
RUN \
apk add --no-cache \
rtl-sdr && \
echo "**** build node application ****" && \
cd /app && chmod +x rtl_433 && npm install && NODE_OPTIONS=--openssl-legacy-provider npm run build && mv build/main.js . && \
echo "**** cleanup ****" && \
rm -rf \
package*.json \
build \
src
# ports and volumes
EXPOSE 9122
VOLUME /config
CMD ["node", "main.js"]