forked from jbuehl/solaredge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.alpine
38 lines (29 loc) · 1.11 KB
/
Containerfile.alpine
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
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Copyright (C) 2023 Olliver Schinagl <[email protected]>
ARG PYTHON_VERSION="3-alpine"
FROM index.docker.io/library/python:${PYTHON_VERSION}
COPY requirements.txt /tmp/
RUN apk add --no-cache --virtual .build-deps \
gcc \
musl-dev \
linux-headers \
&& \
pip --no-cache-dir install --requirement '/tmp/requirements.txt' && \
rm '/tmp/requirements.txt' && \
apk del .build-deps && \
install -d -m 0775 '/usr/local/src' && \
addgroup -S 'semonitor' && \
adduser -D -G 'semonitor' -h '/usr/local/src/semonitor' -s '/bin/nologin' -S 'semonitor' && \
adduser 'semonitor' 'usb' && \
install -d -m 0775 -g 'semonitor' -o 'semonitor' '/var/lib/semonitor'
VOLUME /var/lib/semonitor
WORKDIR /usr/local/src/semonitor/
COPY conversion /usr/local/src/semonitor/conversion
COPY scripts/semonitor.sh /usr/local/bin/semonitor.sh
COPY se /usr/local/src/semonitor/se
COPY semonitor.py /usr/local/src/semonitor/semonitor.py
COPY services/container-entrypoint.sh /init
COPY utilities /usr/local/src/semonitor/utilities
USER semonitor
ENTRYPOINT [ "/init" ]