forked from PX4/flight_review
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (36 loc) · 1.19 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
FROM ubuntu:18.04
ARG CESIUM_API_KEY
ARG MAPBOX_API_ACCESS_TOKEN
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN apt-get install -y python3-dev
RUN apt-get install -y sqlite3
RUN apt-get install -y fftw3
RUN apt-get install -y libfftw3-dev
RUN apt-get install -y git
RUN apt-get -y upgrade
RUN pip3 install --system pipenv
RUN echo PATH="$HOME/.local/bin:$PATH" >> ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
## use local project source
COPY . flight_review
WORKDIR flight_review
## set cesium and mabox keys
RUN echo "[general]" >> config_user.ini
RUN echo "cesium_api_key = $CESIUM_API_KEY" >> config_user.ini
RUN echo "mapbox_api_access_token = $MAPBOX_API_ACCESS_TOKEN" >> config_user.ini
## required for pipenv to run
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN pipenv --three
RUN pipenv sync
## app setup
RUN pipenv run python setup_db.py
EXPOSE 5006
CMD ["pipenv", "run", "python3", "serve.py"]
## USAGE
## ## ## ## ## ## ## ## ## ## ## ##
## BUILD docker build --build-arg CESIUM_API_KEY=[cesium-key] --build-arg MAPBOX_API_ACCESS_TOKEN=[mapbox_key] -t px4flightreview .
## RUN docker run -d -p 5006:5006 px4flightreview