forked from wiktorn/Overpass-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
95 lines (77 loc) · 2.64 KB
/
Dockerfile.template
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM nginx:1.14 AS builder
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install --no-install-recommends --no-install-suggests -y \
autoconf \
automake \
bash \
bzip2 \
ca-certificates \
curl \
expat \
fcgiwrap \
g++ \
libexpat1-dev \
liblz4-1 \
liblz4-dev \
libtool \
m4 \
make \
osmium-tool \
python3 \
python3-venv \
supervisor \
wget \
zlib1g \
zlib1g-dev
ADD http://dev.overpass-api.de/releases/osm-3s_v{version}.tar.gz /app/src.tar.gz
RUN mkdir -p /app/src \
&& cd /app/src \
&& tar -x -z --strip-components 1 -f ../src.tar.gz \
&& autoscan \
&& aclocal \
&& autoheader \
&& libtoolize \
&& automake --add-missing \
&& autoconf \
&& CXXFLAGS='-O2' CFLAGS='-O2' ./configure --prefix=/app --enable-lz4 \
&& make -j $(grep -c ^processor /proc/cpuinfo) dist install clean \
&& mkdir -p /db/diffs /app/etc \
&& cp -r /app/src/rules /app/etc/rules \
&& rm -rf /app/src /app/src.tar.gz
FROM nginx:1.14
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install --no-install-recommends --no-install-suggests -y \
bash \
bzip2 \
ca-certificates \
curl \
expat \
fcgiwrap \
liblz4-1 \
osmium-tool \
python3 \
python3-venv \
supervisor \
wget \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app /app
ADD https://raw.githubusercontent.com/geofabrik/sendfile_osm_oauth_protector/7a6e540734d36dce94aa6be5194c08af1eee2d3f/oauth_cookie_client.py \
/app/bin/
RUN addgroup overpass && adduser --home /db --disabled-password --gecos overpass --ingroup overpass overpass
COPY requirements.txt /app/
RUN python3 -m venv /app/venv \
&& /app/venv/bin/pip install -r /app/requirements.txt
RUN mkdir /nginx /docker-entrypoint-initdb.d && chown nginx:nginx /nginx && chown -R overpass:overpass /db
COPY etc/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY etc/nginx-overpass.conf /etc/nginx/nginx.conf
COPY bin/update_overpass.sh bin/update_overpass_loop.sh bin/rules_loop.sh bin/dispatcher_start.sh bin/start_fcgiwarp.sh /app/bin/
COPY docker-entrypoint.sh /app/
RUN chmod a+rx /app/docker-entrypoint.sh /app/bin/update_overpass.sh /app/bin/rules_loop.sh /app/bin/dispatcher_start.sh \
/app/bin/oauth_cookie_client.py /app/bin/start_fcgiwarp.sh
ENV OVERPASS_RULES_LOAD 1
EXPOSE 80
# CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/app/docker-entrypoint.sh"]