forked from projecthorus/chasemapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
79 lines (70 loc) · 2.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# -------------------
# 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 \
cmake \
libglib2.0-dev \
python3 \
python3-dateutil \
python3-fastkml \
python3-flask \
python3-gdal \
python3-numpy \
python3-pip \
python3-requests \
python3-serial \
python3-setuptools \
python3-shapely \
unzip && \
rm -rf /var/lib/apt/lists/*
# Install additional Python packages that aren't available through apt-get.
RUN pip3 --no-cache-dir install \
flask-socketio==4.3.2 \
pytz
# Download and install cusf_predictor_wrapper, and build predictor binary.
ADD https://github.com/darksidelemm/cusf_predictor_wrapper/archive/master.zip /root/cusf_predictor_wrapper-master.zip
RUN unzip /root/cusf_predictor_wrapper-master.zip -d /root && \
rm /root/cusf_predictor_wrapper-master.zip && \
cd /root/cusf_predictor_wrapper-master && \
python3 setup.py install && \
cd src && \
mkdir build && \
cd build && \
cmake ../ && \
make
# -------------------------
# The application container
# -------------------------
FROM debian:buster-slim
EXPOSE 5001/tcp
# Update system packages and install build dependencies.
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
libglib2.0 \
python3 \
python3-dateutil \
python3-fastkml \
python3-flask \
python3-gdal \
python3-numpy \
python3-requests \
python3-serial \
python3-shapely \
unzip && \
rm -rf /var/lib/apt/lists/*
# 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
# Copy predictor binary and get_wind_data.py from the build container.
COPY --from=build /root/cusf_predictor_wrapper-master/src/build/pred /opt/chasemapper/
COPY --from=build /root/cusf_predictor_wrapper-master/apps/get_wind_data.py /opt/chasemapper/
# Copy in chasemapper.
COPY . /opt/chasemapper
# Run horusmapper.py.
WORKDIR /opt/chasemapper
CMD ["python3", "/opt/chasemapper/horusmapper.py"]