-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
58 lines (49 loc) · 1.48 KB
/
Dockerfile.dev
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
### Pull official base image with Debian OS
FROM python:3.11.8-slim-bookworm
### Set work directory
WORKDIR /app
### Create a virtual environment for code and c++ library installation
ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv ${VIRTUAL_ENV} --prompt=catch-apis-dev
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
### Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV LDFLAGS="-L/$VIRTUAL_ENV/lib -Wl,-rpath=/$VIRTUAL_ENV/lib"
ENV CXXFLAGS="-I/$VIRTUAL_ENV/include"
### Install system dependencies
RUN apt-get update && apt-get install -y \
# Stuff for our flask app
netcat-openbsd \
inotify-tools \
# Useful stuff
mg \
vim \
# Stuff for S2 Geometry: https://s2geometry.io/about/platforms
git \
wget \
libgflags-dev \
libgoogle-glog-dev \
libgtest-dev \
libssl-dev \
swig \
cmake \
g++
### Add some tools to make trouble-shooting in container easier
SHELL ["/bin/bash", "-c"]
RUN source <(wget -qO- https://raw.githubusercontent.com/d-w-d/myconfig/master/quickstart.sh) \
&& myconfig install -y self
### Install S2; see: https://s2geometry.io/about/platforms; this copy-run
# avoids rebuilding when any python source is modified
WORKDIR /app
COPY ./_build_s2 ./
RUN ./_build_s2
### Install python dependencies
COPY . /app/src
WORKDIR /app/src
RUN pip install -q -U pip setuptools wheel
RUN pip install --src=/catchlibs -r requirements.dev.txt
### Setup app directory
WORKDIR /app/src
RUN mkdir -p log
# Start up command issued in docker-compose files