mirror of
https://github.com/nikdoof/aaisp2mqtt.git
synced 2025-12-19 21:59:21 +00:00
Merge pull request #2 from GP8x/docker-improvements
Docker improvements
This commit is contained in:
39
Dockerfile
39
Dockerfile
@@ -1,29 +1,20 @@
|
||||
FROM alpine:3.5
|
||||
FROM alpine:3.6
|
||||
MAINTAINER Nat Morris <nat@nuqe.net>
|
||||
|
||||
RUN apk add --update \
|
||||
python \
|
||||
python-dev \
|
||||
py-pip \
|
||||
build-base \
|
||||
&& pip install virtualenv
|
||||
|
||||
#ENV LIBRARY_PATH=/lib:/usr/lib
|
||||
#RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
|
||||
|
||||
# Copy requirements before app so we can cache PIP dependencies on their own
|
||||
RUN mkdir /app
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
WORKDIR /app
|
||||
RUN virtualenv /env && /env/bin/pip install -r /app/requirements.txt
|
||||
|
||||
COPY requirements.txt /app/
|
||||
COPY aaisp-to-mqtt.py /app/
|
||||
WORKDIR /app
|
||||
|
||||
RUN rm -rf \
|
||||
/root/.cache \
|
||||
/tmp/*
|
||||
RUN rm -rf /var/cache/apk/*
|
||||
RUN apk add --no-cache \
|
||||
python \
|
||||
ca-certificates \
|
||||
&& apk add --no-cache --virtual .build-deps \
|
||||
py-pip \
|
||||
&& pip install -r requirements.txt \
|
||||
&& apk del --no-cache .build-deps \
|
||||
&& addgroup -g 1000 aaisp \
|
||||
&& adduser -u 1000 -G aaisp -s /bin/sh -D aaisp \
|
||||
&& chown aaisp:aaisp -R /app \
|
||||
&& echo "0 * * * * /usr/bin/python /app/aaisp-to-mqtt.py /app/config.cfg" | crontab -u aaisp -
|
||||
|
||||
EXPOSE 8080/tcp
|
||||
|
||||
CMD ["/env/bin/python", "/app/aaisp-to-mqtt.py", "-c /config/config.cfg"]
|
||||
CMD ["/usr/sbin/crond", "-f", "-d", "8"]
|
||||
|
||||
14
README.md
14
README.md
@@ -133,6 +133,20 @@ aaisp/login/gb12@a.1/syncrate/up 1205000
|
||||
aaisp/login/gb12@a.1/syncrate/up/human 1.21 MB
|
||||
```
|
||||
|
||||
## Docker ##
|
||||
|
||||
Build the Docker image with:
|
||||
|
||||
```
|
||||
docker build -t aaisp-mqtt .
|
||||
```
|
||||
|
||||
Run the container with a volume mounted config file:
|
||||
|
||||
```
|
||||
docker run -d -v <path_to_config>:/app/config.cfg --name AAISPmqtt aaisp-mqtt
|
||||
```
|
||||
|
||||
## Setup ##
|
||||
|
||||
TODO
|
||||
|
||||
Reference in New Issue
Block a user