This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve docker setup * More fixes * Readme update
- Loading branch information
Showing
6 changed files
with
74 additions
and
92 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,8 @@ | ||
/config.yaml | ||
Dockerfile* | ||
.git | ||
.idea | ||
.venv | ||
.github | ||
__pycache__ | ||
__pycache__/* |
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 |
---|---|---|
@@ -1,37 +1,23 @@ | ||
FROM alpine:3.8 | ||
FROM python:3.8-alpine3.11 | ||
|
||
ENV DEBUG false | ||
|
||
RUN mkdir application | ||
WORKDIR /application | ||
ADD . /application | ||
|
||
RUN apk add --no-cache tzdata python3 git bluez glib-dev make bluez-dev bluez-libs musl-dev linux-headers gcc grep && \ | ||
python3 -m ensurepip && \ | ||
rm -r /usr/lib/python*/ensurepip && \ | ||
pip3 install --upgrade pip setuptools && \ | ||
if [ ! -e /usr/bin/pip ]; then \ | ||
ln -s pip3 /usr/bin/pip ; \ | ||
fi && \ | ||
if [[ ! -e /usr/bin/python ]]; then \ | ||
ln -sf /usr/bin/python3 /usr/bin/python; \ | ||
fi && \ | ||
rm -r /root/.cache && \ | ||
mkdir /config && \ | ||
pip install -r requirements.txt && \ | ||
ln -s /config/config.yaml ./config.yaml && \ | ||
apk del --no-cache bluez-dev musl-dev gcc make git glib-dev linux-headers grep python2 | ||
|
||
RUN apk add --no-cache tzdata python3 git bluez glib-dev make bluez-dev bluez-libs bluez-deprecated musl-dev linux-headers gcc grep sudo && \ | ||
grep -P "(?<=REQUIREMENTS).*" workers/*.py | grep -Po "(?<=\[).*(?=\])" | tr ',' '\n' | tr "'" " "| tr "\"" " " > /tmp/requirements.txt && \ | ||
cat /tmp/requirements.txt && \ | ||
pip install -r /tmp/requirements.txt && \ | ||
rm /tmp/requirements.txt && \ | ||
apk del --no-cache bluez-dev musl-dev gcc make git glib-dev linux-headers grep python2 | ||
|
||
ADD ./start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
ENV DEBUG false | ||
COPY requirements.txt /application | ||
|
||
VOLUME ["/config"] | ||
RUN apk add --no-cache tzdata bluez bluez-libs sudo bluez-deprecated && \ | ||
ln -s /config.yaml ./config.yaml && \ | ||
pip install -r requirements.txt | ||
|
||
COPY . /application | ||
|
||
RUN apk add --no-cache --virtual build-dependencies git bluez-dev musl-dev make gcc glib-dev musl-dev && \ | ||
pip install `./gateway.py -r all` && \ | ||
apk del build-dependencies | ||
|
||
COPY ./start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
ENTRYPOINT ["/bin/sh", "-c", "/start.sh"] |
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
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
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
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