1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-20 08:31:11 -05:00
aprsd/docker/Dockerfile-dev
2022-11-25 11:21:10 -05:00

62 lines
1.7 KiB
Plaintext

# syntax=docker/dockerfile:1
FROM ubuntu:focal as aprsd
# Dockerfile for building a container during aprsd development.
ARG BRANCH=master
ARG UID
ARG GID
ENV APRS_USER=aprs
ENV HOME=/home/aprs
ENV APRSD=http://github.com/craigerl/aprsd.git
ENV APRSD_BRANCH=${BRANCH:-master}
ENV VIRTUAL_ENV=$HOME/.venv3
ENV UID=${UID:-1000}
ENV GID=${GID:-1000}
ENV DEBIAN_FRONTEND=noninteractive
ENV INSTALL=$HOME/install
RUN apt update
RUN apt install -y --no-install-recommends git build-essential bash fortune
RUN apt install -y libffi-dev python3-dev libssl-dev libxml2-dev libxslt-dev
RUN apt install -y python3 python3-pip python3-dev python3-lxml
#RUN apt-get clean
RUN apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase
RUN addgroup --gid 1001 $APRS_USER
RUN useradd -m -u $UID -g $APRS_USER $APRS_USER
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
WORKDIR $HOME
USER $APRS_USER
RUN pip install wheel
#RUN python3 -m venv $VIRTUAL_ENV
#ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN echo "export PATH=\$PATH:\$HOME/.local/bin" >> $HOME/.bashrc
RUN cat $HOME/.bashrc
USER root
WORKDIR $HOME
RUN mkdir $INSTALL
RUN git clone -b $BRANCH $APRSD $INSTALL/aprsd
RUN cd $INSTALL/aprsd && pip3 install -v .
RUN ls -al /usr/local/bin
RUN ls -al /usr/bin
RUN which aprsd
RUN mkdir -p /config
RUN aprsd sample-config > /config/aprsd.yml
RUN chown -R $APRS_USER:$APRS_USER /config
# override this to run another configuration
ENV CONF default
USER $APRS_USER
VOLUME ["/config", "/plugins"]
ADD bin/run.sh $HOME/
ENTRYPOINT ["/home/aprs/run.sh"]
HEALTHCHECK --interval=5m --timeout=12s --start-period=30s \
CMD aprsd healthcheck --config /config/aprsd.yml --url http://localhost:8001/stats