mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-18 06:11:49 -05:00
51 lines
1.2 KiB
Plaintext
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
|
|
|
|
USER root
|
|
WORKDIR $HOME
|
|
RUN mkdir $INSTALL
|
|
RUN git clone -b $APRSD_BRANCH $APRSD $INSTALL/aprsd
|
|
RUN cd $INSTALL/aprsd && pip3 install .
|
|
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"]
|