1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-16 05:12:01 -05:00
aprsd/docker/Dockerfile-dev
Hemna 239e784d51 Added Dockerfile-dev and updated build.sh
Build.sh is used for multi-architecture building of docker images.
2021-02-18 18:59:08 -05:00

51 lines
1.2 KiB
Plaintext

FROM python:3.8-slim as aprsd
# Dockerfile for building a container during aprsd development.
ARG BRANCH
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 INSTALL=$HOME/install
RUN apt update
RUN apt install -y git build-essential
RUN apt install -y libffi-dev python3-dev libssl-dev
RUN apt install -y bash fortune
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
USER $APRS_USER
RUN pip3 install wheel
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN echo "export PATH=\$PATH:\$HOME/.local/bin" >> $HOME/.bashrc
VOLUME ["/config", "/plugins"]
WORKDIR $HOME
RUN mkdir $INSTALL
RUN git clone -b $APRSD_BRANCH $APRSD $INSTALL/aprsd
RUN cd $INSTALL/aprsd && pip3 install .
RUN which aprsd
USER root
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
ADD bin/run.sh $HOME/
ENTRYPOINT ["/home/aprs/run.sh"]