1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-24 08:58:49 -05:00

Compare commits

..

No commits in common. "63962acfe613b574713859aff73417c43fdbe14b" and "fa2d2d965d403c028fd81a15665fe1c42c950692" have entirely different histories.

7 changed files with 215 additions and 404 deletions

View File

@ -43,9 +43,8 @@ jobs:
with: with:
context: "{{defaultContext}}:docker" context: "{{defaultContext}}:docker"
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: ./Dockerfile file: ./Dockerfile-dev
build-args: | build-args: |
INSTALL_TYPE=github
BRANCH=${{ steps.extract_branch.outputs.branch }} BRANCH=${{ steps.extract_branch.outputs.branch }}
BUILDX_QEMU_ENV=true BUILDX_QEMU_ENV=true
push: true push: true

View File

@ -53,9 +53,8 @@ jobs:
with: with:
context: "{{defaultContext}}:docker" context: "{{defaultContext}}:docker"
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: ./Dockerfile file: ./Dockerfile-dev
build-args: | build-args: |
INSTALL_TYPE=github
BRANCH=${{ steps.branch-name.outputs.current_branch }} BRANCH=${{ steps.branch-name.outputs.current_branch }}
BUILDX_QEMU_ENV=true BUILDX_QEMU_ENV=true
push: true push: true

View File

@ -1,18 +1,10 @@
FROM python:3.11-slim as build FROM python:3.11-slim as build
ARG VERSION=3.4.0 ARG VERSION=3.4.0
# pass this in as 'dev' if you want to install from github repo vs pypi
ARG INSTALL_TYPE=pypi
ARG BRANCH=master
ARG BUILDX_QEMU_ENV
ENV APRSD_BRANCH=${BRANCH:-master}
ENV TZ=${TZ:-US/Eastern} ENV TZ=${TZ:-US/Eastern}
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
ENV APRSD_PIP_VERSION=${VERSION} ENV APRSD_PIP_VERSION=${VERSION}
ENV PATH="${PATH}:/app/.local/bin"
ENV PIP_DEFAULT_TIMEOUT=100 \ ENV PIP_DEFAULT_TIMEOUT=100 \
# Allow statements and log messages to immediately appear # Allow statements and log messages to immediately appear
@ -43,22 +35,16 @@ FROM build as final
WORKDIR /app WORKDIR /app
RUN pip3 install -U pip RUN pip3 install -U pip
RUN pip3 install aprsd==$APRSD_PIP_VERSION
RUN pip install gevent uwsgi
RUN which aprsd
RUN mkdir /config RUN mkdir /config
RUN chown -R appuser:appgroup /app RUN chown -R appuser:appgroup /app
RUN chown -R appuser:appgroup /config RUN chown -R appuser:appgroup /config
USER appuser USER appuser
RUN if [ "$INSTALL_TYPE" = "pypi" ]; then \ RUN echo "PATH=\$PATH:/usr/games" >> /app/.bashrc
pip3 install aprsd==$APRSD_PIP_VERSION; \
elif [ "$INSTALL_TYPE" = "github" ]; then \
git clone -b $APRSD_BRANCH https://github.com/craigerl/aprsd; \
cd /app/aprsd && pip install -e .; \
ls -al /app/.local/lib/python3.11/site-packages/aprsd*; \
fi
RUN pip install gevent uwsgi
RUN echo "PATH=\$PATH:/usr/games:/app/.local/bin" >> /app/.bashrc
RUN which aprsd RUN which aprsd
RUN aprsd sample-config > /config/aprsd.conf RUN aprsd sample-config > /config/aprsd.conf
RUN aprsd --version
ADD bin/setup.sh /app ADD bin/setup.sh /app
ADD bin/admin.sh /app ADD bin/admin.sh /app

60
docker/Dockerfile-dev Normal file
View File

@ -0,0 +1,60 @@
FROM python:3.11-slim as build
ARG BRANCH=master
ARG BUILDX_QEMU_ENV
ENV APRSD_BRANCH=${BRANCH:-master}
ENV PIP_DEFAULT_TIMEOUT=100 \
# Allow statements and log messages to immediately appear
PYTHONUNBUFFERED=1 \
# disable a pip version check to reduce run-time & log-spam
PIP_DISABLE_PIP_VERSION_CHECK=1 \
# cache is useless in docker image, so disable to reduce image size
PIP_NO_CACHE_DIR=1
RUN set -ex \
# Create a non-root user
&& addgroup --system --gid 1001 appgroup \
&& useradd --uid 1001 --gid 1001 -s /usr/bin/bash -m -d /app appuser \
# Upgrade the package index and install security upgrades
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y git build-essential curl libffi-dev fortune \
python3-dev libssl-dev libxml2-dev libxslt-dev telnet sudo \
# Install dependencies
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y
### Final stage
FROM build as final
WORKDIR /app
RUN git clone -b $APRSD_BRANCH https://github.com/craigerl/aprsd
RUN pip install -U pip
RUN cd aprsd && pip install --no-cache-dir .
RUN pip install gevent uwsgi==2.0.24
RUN which aprsd
RUN mkdir /config
RUN chown -R appuser:appgroup /app
RUN chown -R appuser:appgroup /config
USER appuser
RUN echo "PATH=\$PATH:/usr/games" >> /app/.bashrc
RUN which aprsd
RUN aprsd sample-config > /config/aprsd.conf
ADD bin/setup.sh /app
ADD bin/admin.sh /app
EXPOSE 8000
EXPOSE 8001
VOLUME ["/config"]
# CMD ["gunicorn", "aprsd.wsgi:app", "--host", "0.0.0.0", "--port", "8000"]
ENTRYPOINT ["/app/setup.sh"]
CMD ["server"]
# Set the user to run the application
USER appuser

View File

@ -90,8 +90,7 @@ then
# Use this script to locally build the docker image # Use this script to locally build the docker image
docker buildx build --push --platform $PLATFORMS \ docker buildx build --push --platform $PLATFORMS \
-t hemna6969/aprsd:$TAG \ -t hemna6969/aprsd:$TAG \
--build-arg INSTALL_TYPE=github \ -f Dockerfile-dev --build-arg branch=$BRANCH \
--build-arg branch=$BRANCH \
--build-arg BUILDX_QEMU_ENV=true \ --build-arg BUILDX_QEMU_ENV=true \
--no-cache . --no-cache .
else else
@ -102,5 +101,6 @@ else
--build-arg BUILDX_QEMU_ENV=true \ --build-arg BUILDX_QEMU_ENV=true \
-t hemna6969/aprsd:$VERSION \ -t hemna6969/aprsd:$VERSION \
-t hemna6969/aprsd:$TAG \ -t hemna6969/aprsd:$TAG \
-t hemna6969/aprsd:latest . -t hemna6969/aprsd:latest \
-f Dockerfile .
fi fi

View File

@ -4,212 +4,80 @@
# #
# pip-compile --annotation-style=line requirements-dev.in # pip-compile --annotation-style=line requirements-dev.in
# #
add-trailing-comma==3.1.0 add-trailing-comma==3.1.0 # via gray
# via gray alabaster==0.7.16 # via sphinx
alabaster==0.7.16 autoflake==1.5.3 # via gray
# via sphinx babel==2.15.0 # via sphinx
autoflake==1.5.3 black==24.4.2 # via gray
# via gray build==1.2.1 # via -r requirements-dev.in, check-manifest, pip-tools
babel==2.15.0 cachetools==5.3.3 # via tox
# via sphinx certifi==2024.2.2 # via requests
black==24.4.2 cfgv==3.4.0 # via pre-commit
# via gray chardet==5.2.0 # via tox
build==1.2.1 charset-normalizer==3.3.2 # via requests
# via check-manifest==0.49 # via -r requirements-dev.in
# -r requirements-dev.in click==8.1.7 # via black, fixit, moreorless, pip-tools
# check-manifest colorama==0.4.6 # via tox
# pip-tools commonmark==0.9.1 # via rich
cachetools==5.3.3 configargparse==1.7 # via gray
# via tox coverage[toml]==7.5.1 # via pytest-cov
certifi==2024.2.2 distlib==0.3.8 # via virtualenv
# via requests docutils==0.21.2 # via sphinx
cfgv==3.4.0 exceptiongroup==1.2.1 # via pytest
# via pre-commit filelock==3.14.0 # via tox, virtualenv
chardet==5.2.0 fixit==2.1.0 # via gray
# via tox flake8==7.0.0 # via -r requirements-dev.in, pep8-naming
charset-normalizer==3.3.2 gray==0.15.0 # via -r requirements-dev.in
# via requests identify==2.5.36 # via pre-commit
check-manifest==0.49 idna==3.7 # via requests
# via -r requirements-dev.in imagesize==1.4.1 # via sphinx
click==8.1.7 iniconfig==2.0.0 # via pytest
# via isort==5.13.2 # via -r requirements-dev.in, gray
# black jinja2==3.1.4 # via sphinx
# fixit libcst==1.3.1 # via fixit
# moreorless markupsafe==2.1.5 # via jinja2
# pip-tools mccabe==0.7.0 # via flake8
colorama==0.4.6 moreorless==0.4.0 # via fixit
# via tox mypy==1.10.0 # via -r requirements-dev.in
commonmark==0.9.1 mypy-extensions==1.0.0 # via black, mypy
# via rich nodeenv==1.8.0 # via pre-commit
configargparse==1.7 packaging==24.0 # via black, build, fixit, pyproject-api, pytest, sphinx, tox
# via gray pathspec==0.12.1 # via black, trailrunner
coverage[toml]==7.5.1 pep8-naming==0.14.1 # via -r requirements-dev.in
# via pytest-cov pip-tools==7.4.1 # via -r requirements-dev.in
distlib==0.3.8 platformdirs==4.2.2 # via black, tox, virtualenv
# via virtualenv pluggy==1.5.0 # via pytest, tox
docutils==0.21.2 pre-commit==3.7.1 # via -r requirements-dev.in
# via sphinx pycodestyle==2.11.1 # via flake8
exceptiongroup==1.2.1 pyflakes==3.2.0 # via autoflake, flake8
# via pytest pygments==2.18.0 # via rich, sphinx
filelock==3.14.0 pyproject-api==1.6.1 # via tox
# via pyproject-hooks==1.1.0 # via build, pip-tools
# tox pytest==8.2.0 # via -r requirements-dev.in, pytest-cov
# virtualenv pytest-cov==5.0.0 # via -r requirements-dev.in
fixit==2.1.0 pyupgrade==3.15.2 # via gray
# via gray pyyaml==6.0.1 # via libcst, pre-commit
flake8==7.0.0 requests==2.31.0 # via sphinx
# via rich==12.6.0 # via gray
# -r requirements-dev.in snowballstemmer==2.2.0 # via sphinx
# pep8-naming sphinx==7.3.7 # via -r requirements-dev.in
gray==0.15.0 sphinxcontrib-applehelp==1.0.8 # via sphinx
# via -r requirements-dev.in sphinxcontrib-devhelp==1.0.6 # via sphinx
identify==2.5.36 sphinxcontrib-htmlhelp==2.0.5 # via sphinx
# via pre-commit sphinxcontrib-jsmath==1.0.1 # via sphinx
idna==3.7 sphinxcontrib-qthelp==1.0.7 # via sphinx
# via requests sphinxcontrib-serializinghtml==1.1.10 # via sphinx
imagesize==1.4.1 tokenize-rt==5.2.0 # via add-trailing-comma, pyupgrade
# via sphinx toml==0.10.2 # via autoflake
iniconfig==2.0.0 tomli==2.0.1 # via black, build, check-manifest, coverage, fixit, mypy, pip-tools, pyproject-api, pytest, sphinx, tox
# via pytest tox==4.15.0 # via -r requirements-dev.in
isort==5.13.2 trailrunner==1.4.0 # via fixit
# via typing-extensions==4.11.0 # via black, mypy
# -r requirements-dev.in unify==0.5 # via gray
# gray untokenize==0.1.1 # via unify
jinja2==3.1.4 urllib3==2.2.1 # via requests
# via sphinx virtualenv==20.26.2 # via pre-commit, tox
libcst==1.3.1 wheel==0.43.0 # via -r requirements-dev.in, pip-tools
# via fixit
markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via flake8
moreorless==0.4.0
# via fixit
mypy==1.10.0
# via -r requirements-dev.in
mypy-extensions==1.0.0
# via
# black
# mypy
nodeenv==1.8.0
# via pre-commit
packaging==24.0
# via
# black
# build
# fixit
# pyproject-api
# pytest
# sphinx
# tox
pathspec==0.12.1
# via
# black
# trailrunner
pep8-naming==0.14.1
# via -r requirements-dev.in
pip-tools==7.4.1
# via -r requirements-dev.in
platformdirs==4.2.2
# via
# black
# tox
# virtualenv
pluggy==1.5.0
# via
# pytest
# tox
pre-commit==3.7.1
# via -r requirements-dev.in
pycodestyle==2.11.1
# via flake8
pyflakes==3.2.0
# via
# autoflake
# flake8
pygments==2.18.0
# via
# rich
# sphinx
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.2.0
# via
# -r requirements-dev.in
# pytest-cov
pytest-cov==5.0.0
# via -r requirements-dev.in
pyupgrade==3.15.2
# via gray
pyyaml==6.0.1
# via
# libcst
# pre-commit
requests==2.32.0
# via sphinx
rich==12.6.0
# via gray
snowballstemmer==2.2.0
# via sphinx
sphinx==7.3.7
# via -r requirements-dev.in
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tokenize-rt==5.2.0
# via
# add-trailing-comma
# pyupgrade
toml==0.10.2
# via autoflake
tomli==2.0.1
# via
# black
# build
# check-manifest
# coverage
# fixit
# mypy
# pip-tools
# pyproject-api
# pytest
# sphinx
# tox
tox==4.15.0
# via -r requirements-dev.in
trailrunner==1.4.0
# via fixit
typing-extensions==4.11.0
# via
# black
# mypy
unify==0.5
# via gray
untokenize==0.1.1
# via unify
urllib3==2.2.1
# via requests
virtualenv==20.26.2
# via
# pre-commit
# tox
wheel==0.43.0
# via
# -r requirements-dev.in
# pip-tools
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# pip # pip

View File

@ -4,179 +4,78 @@
# #
# pip-compile --annotation-style=line requirements.in # pip-compile --annotation-style=line requirements.in
# #
aprslib==0.7.2 aprslib==0.7.2 # via -r requirements.in
# via -r requirements.in attrs==23.2.0 # via ax253, kiss3, rush
attrs==23.2.0 ax253==0.1.5.post1 # via kiss3
# via beautifulsoup4==4.12.3 # via -r requirements.in
# ax253 bidict==0.23.1 # via python-socketio
# kiss3 bitarray==2.9.2 # via ax253, kiss3
# rush blinker==1.8.2 # via flask
ax253==0.1.5.post1 certifi==2024.2.2 # via requests
# via kiss3 charset-normalizer==3.3.2 # via requests
beautifulsoup4==4.12.3 click==8.1.7 # via -r requirements.in, click-params, flask
# via -r requirements.in click-params==0.5.0 # via -r requirements.in
bidict==0.23.1 commonmark==0.9.1 # via rich
# via python-socketio dataclasses==0.6 # via -r requirements.in
bitarray==2.9.2 dataclasses-json==0.6.6 # via -r requirements.in
# via debtcollector==3.0.0 # via oslo-config
# ax253 deprecated==1.2.14 # via click-params
# kiss3 dnspython==2.6.1 # via eventlet
blinker==1.8.2 eventlet==0.36.1 # via -r requirements.in
# via flask flask==3.0.3 # via -r requirements.in, flask-httpauth, flask-socketio
certifi==2024.2.2 flask-httpauth==4.8.0 # via -r requirements.in
# via requests flask-socketio==5.3.6 # via -r requirements.in
charset-normalizer==3.3.2 geographiclib==2.0 # via geopy
# via requests geopy==2.4.1 # via -r requirements.in
click==8.1.7 gevent==24.2.1 # via -r requirements.in
# via greenlet==3.0.3 # via eventlet, gevent
# -r requirements.in h11==0.14.0 # via wsproto
# click-params idna==3.7 # via requests
# flask imapclient==3.0.1 # via -r requirements.in
click-params==0.5.0 importlib-metadata==7.1.0 # via ax253, kiss3
# via -r requirements.in itsdangerous==2.2.0 # via flask
commonmark==0.9.1 jinja2==3.1.4 # via flask
# via rich kiss3==8.0.0 # via -r requirements.in
dataclasses==0.6 loguru==0.7.2 # via -r requirements.in
# via -r requirements.in markupsafe==2.1.5 # via jinja2, werkzeug
dataclasses-json==0.6.6 marshmallow==3.21.2 # via dataclasses-json
# via -r requirements.in mypy-extensions==1.0.0 # via typing-inspect
debtcollector==3.0.0 netaddr==1.2.1 # via oslo-config
# via oslo-config oslo-config==9.4.0 # via -r requirements.in
deprecated==1.2.14 oslo-i18n==6.3.0 # via oslo-config
# via click-params packaging==24.0 # via marshmallow
dnspython==2.6.1 pbr==6.0.0 # via oslo-i18n, stevedore
# via eventlet pluggy==1.5.0 # via -r requirements.in
eventlet==0.36.1 pygments==2.18.0 # via rich
# via -r requirements.in pyserial==3.5 # via pyserial-asyncio
flask==3.0.3 pyserial-asyncio==0.6 # via kiss3
# via python-engineio==4.9.0 # via python-socketio
# -r requirements.in python-socketio==5.11.2 # via -r requirements.in, flask-socketio
# flask-httpauth pytz==2024.1 # via -r requirements.in
# flask-socketio pyyaml==6.0.1 # via -r requirements.in, oslo-config
flask-httpauth==4.8.0 requests==2.31.0 # via -r requirements.in, oslo-config, update-checker
# via -r requirements.in rfc3986==2.0.0 # via oslo-config
flask-socketio==5.3.6 rich==12.6.0 # via -r requirements.in
# via -r requirements.in rush==2021.4.0 # via -r requirements.in
geographiclib==2.0 shellingham==1.5.4 # via -r requirements.in
# via geopy simple-websocket==1.0.0 # via python-engineio
geopy==2.4.1 six==1.16.0 # via -r requirements.in
# via -r requirements.in soupsieve==2.5 # via beautifulsoup4
gevent==24.2.1 stevedore==5.2.0 # via oslo-config
# via -r requirements.in tabulate==0.9.0 # via -r requirements.in
greenlet==3.0.3 thesmuggler==1.0.1 # via -r requirements.in
# via typing-extensions==4.11.0 # via typing-inspect
# eventlet typing-inspect==0.9.0 # via dataclasses-json
# gevent tzlocal==5.2 # via -r requirements.in
h11==0.14.0 update-checker==0.18.0 # via -r requirements.in
# via wsproto urllib3==2.2.1 # via requests
idna==3.7 validators==0.22.0 # via click-params
# via requests werkzeug==3.0.3 # via flask
imapclient==3.0.1 wrapt==1.16.0 # via -r requirements.in, debtcollector, deprecated
# via -r requirements.in wsproto==1.2.0 # via simple-websocket
importlib-metadata==7.1.0 zipp==3.18.2 # via importlib-metadata
# via zope-event==5.0 # via gevent
# ax253 zope-interface==6.4 # via gevent
# kiss3
itsdangerous==2.2.0
# via flask
jinja2==3.1.4
# via flask
kiss3==8.0.0
# via -r requirements.in
loguru==0.7.2
# via -r requirements.in
markupsafe==2.1.5
# via
# jinja2
# werkzeug
marshmallow==3.21.2
# via dataclasses-json
mypy-extensions==1.0.0
# via typing-inspect
netaddr==1.2.1
# via oslo-config
oslo-config==9.4.0
# via -r requirements.in
oslo-i18n==6.3.0
# via oslo-config
packaging==24.0
# via marshmallow
pbr==6.0.0
# via
# oslo-i18n
# stevedore
pluggy==1.5.0
# via -r requirements.in
pygments==2.18.0
# via rich
pyserial==3.5
# via pyserial-asyncio
pyserial-asyncio==0.6
# via kiss3
python-engineio==4.9.0
# via python-socketio
python-socketio==5.11.2
# via
# -r requirements.in
# flask-socketio
pytz==2024.1
# via -r requirements.in
pyyaml==6.0.1
# via
# -r requirements.in
# oslo-config
requests==2.32.0
# via
# -r requirements.in
# oslo-config
# update-checker
rfc3986==2.0.0
# via oslo-config
rich==12.6.0
# via -r requirements.in
rush==2021.4.0
# via -r requirements.in
shellingham==1.5.4
# via -r requirements.in
simple-websocket==1.0.0
# via python-engineio
six==1.16.0
# via -r requirements.in
soupsieve==2.5
# via beautifulsoup4
stevedore==5.2.0
# via oslo-config
tabulate==0.9.0
# via -r requirements.in
thesmuggler==1.0.1
# via -r requirements.in
typing-extensions==4.11.0
# via typing-inspect
typing-inspect==0.9.0
# via dataclasses-json
tzlocal==5.2
# via -r requirements.in
update-checker==0.18.0
# via -r requirements.in
urllib3==2.2.1
# via requests
validators==0.22.0
# via click-params
werkzeug==3.0.3
# via flask
wrapt==1.16.0
# via
# -r requirements.in
# debtcollector
# deprecated
wsproto==1.2.0
# via simple-websocket
zipp==3.18.2
# via importlib-metadata
zope-event==5.0
# via gevent
zope-interface==6.4
# via gevent
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# setuptools # setuptools