radiosonde_auto_rx/Dockerfile

61 wiersze
1.5 KiB
Docker
Czysty Zwykły widok Historia

2019-10-17 10:00:15 +00:00
# -------------------
# The build container
# -------------------
FROM debian:buster-slim AS build
# Update system packages and install build dependencies.
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
build-essential \
python3 \
python3-crcmod \
python3-dateutil \
python3-flask \
python3-numpy \
python3-pip \
python3-requests && \
rm -rf /var/lib/apt/lists/*
# Copy in radiosonde_auto_rx
COPY . /root/radiosonde_auto_rx
2019-10-17 10:00:15 +00:00
# Install additional Python packages that aren't available through apt-get.
RUN pip3 --no-cache-dir install -r /root/radiosonde_auto_rx/auto_rx/requirements.txt
2019-10-17 10:00:15 +00:00
# Build the binaries.
2019-10-17 10:00:15 +00:00
RUN cd /root/radiosonde_auto_rx/auto_rx && \
sh build.sh
# -------------------------
# The application container
# -------------------------
FROM debian:buster-slim
2019-10-12 11:04:00 +00:00
EXPOSE 5000/tcp
2019-10-17 10:00:15 +00:00
# Update system packages and install application dependencies.
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
2019-10-12 11:04:00 +00:00
python3 \
python3-crcmod \
python3-dateutil \
python3-flask \
python3-numpy \
python3-requests \
2019-10-12 11:04:00 +00:00
rng-tools \
rtl-sdr \
2019-10-12 11:04:00 +00:00
sox \
usbutils && \
rm -rf /var/lib/apt/lists/*
2019-10-12 11:04:00 +00:00
2019-10-17 10:00:15 +00:00
# Copy any additional Python packages from the build container.
COPY --from=build /usr/local/lib/python3.7/dist-packages /usr/local/lib/python3.7/dist-packages
2019-10-17 10:00:15 +00:00
# Copy auto_rx from the build container to /opt.
COPY --from=build /root/radiosonde_auto_rx/auto_rx /opt/auto_rx
# Run auto_rx.py.
2019-10-12 11:04:00 +00:00
WORKDIR /opt/auto_rx
CMD ["python3", "/opt/auto_rx/auto_rx.py"]