diff --git a/Dockerfile b/Dockerfile index 6261028..567e6ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,9 @@ -FROM alpine:3.6 -MAINTAINER Nat Morris +FROM python:3.8-alpine COPY requirements.txt /app/ COPY aaisp-to-mqtt.py /app/ WORKDIR /app -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 - +RUN pip install -r requirements.txt -CMD ["/usr/sbin/crond", "-f", "-d", "8"] +CMD ["/usr/bin/python", "/app/aaisp-to-mqtt.py"] diff --git a/README.md b/README.md index 331ae17..3094814 100644 --- a/README.md +++ b/README.md @@ -141,12 +141,24 @@ Build the Docker image with: docker build -t aaisp-mqtt . ``` -Run the container with a volume mounted config file: +### Configuration ### + +You have two options for passing the configuration to the container. Either you can run the container with a volume mounted config file: ``` docker run -d -v :/app/config.cfg --name AAISPmqtt aaisp-mqtt ``` +Or you can pass the configuration values as environment variables: + +* AAISP_USERNAME +* AAISP_PASSWORD +* MQTT_BROKER +* MQTT_PORT +* MQTT_USERNAME +* MQTT_PASSWORD +* MQTT_TOPIC_PREFIX + ## Setup ## TODO