1
0
mirror of https://github.com/craigerl/aprsd.git synced 2026-06-01 13:45:06 -04:00
Files
aprsd/docker/Dockerfile-dev
T

61 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-07-17 13:25:03 +00:00
FROM python:3.11-slim as build
2023-07-17 11:46:54 -04:00
ARG BRANCH=master
ARG BUILDX_QEMU_ENV
ENV APRSD_BRANCH=${BRANCH:-master}
2023-07-17 13:25:03 +00:00
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 \
2023-07-17 13:25:03 +00:00
# Upgrade the package index and install security upgrades
&& apt-get update \
&& apt-get upgrade -y \
2024-01-08 19:40:08 +00:00
&& apt-get install -y git build-essential curl libffi-dev fortune \
2023-07-24 00:13:28 +00:00
python3-dev libssl-dev libxml2-dev libxslt-dev telnet sudo \
2023-07-17 13:25:03 +00:00
# Install dependencies
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y
### Final stage
FROM build as final
WORKDIR /app
2023-07-17 13:25:03 +00:00
2023-07-17 11:46:54 -04:00
RUN git clone -b $APRSD_BRANCH https://github.com/craigerl/aprsd
2024-04-08 17:00:42 -04:00
RUN pip install -U pip
2023-07-17 13:25:03 +00:00
RUN cd aprsd && pip install --no-cache-dir .
2024-04-14 20:27:26 -04:00
RUN pip install gevent uwsgi==2.0.24
2023-07-17 13:25:03 +00:00
RUN which aprsd
RUN mkdir /config
RUN chown -R appuser:appgroup /app
RUN chown -R appuser:appgroup /config
USER appuser
2024-01-08 22:56:45 +00:00
RUN echo "PATH=\$PATH:/usr/games" >> /app/.bashrc
2021-02-18 18:59:08 -05:00
RUN which aprsd
2022-12-27 15:44:32 -05:00
RUN aprsd sample-config > /config/aprsd.conf
2021-02-18 18:59:08 -05:00
2024-04-23 09:38:37 -04:00
ADD bin/setup.sh /app
2023-07-17 13:25:03 +00:00
ADD bin/admin.sh /app
EXPOSE 8000
2024-04-23 09:38:37 -04:00
EXPOSE 8001
2021-02-18 18:59:08 -05:00
2023-07-17 13:25:03 +00:00
VOLUME ["/config"]
2024-04-23 09:38:37 -04:00
# CMD ["gunicorn", "aprsd.wsgi:app", "--host", "0.0.0.0", "--port", "8000"]
ENTRYPOINT ["/app/setup.sh"]
CMD ["server"]
2023-07-17 13:25:03 +00:00
# Set the user to run the application
USER appuser