forked from vdct/ProjetDuMois
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.82 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
FROM node:14.18.0-bullseye-slim
ENV DB_URL=postgres://localhost:5432/osm
ENV PORT=3000
ARG IMPOSM3_VERSION=0.11.0
RUN groupadd --gid 10001 -r osm \
&& useradd --uid 10001 -d /home/osm -m -r -s /bin/false -g osm osm \
&& mkdir -p /data/files/pdm /opt/pdm /opt/imposm3 \
&& apt-get update \
&& apt-get -y install --no-install-recommends \
apt-utils curl xsltproc osmctools ca-certificates gnupg \
&& curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get -y --no-install-recommends install postgresql-client-13 libpq-dev libgeos-dev osmium-tool python3 python3-requests bc \
&& apt-get clean \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/imposm3
RUN curl -L https://github.com/omniscale/imposm3/releases/download/v${IMPOSM3_VERSION}/imposm-${IMPOSM3_VERSION}-linux-x86-64.tar.gz -o imposm3.tar.gz \
&& tar -xvf imposm3.tar.gz --strip 1 \
&& rm -f imposm3.tar.gz \
&& chmod a+x ./imposm \
&& cp ./imposm /usr/local/bin/ \
&& cp ./lib/* /usr/lib/
WORKDIR /opt/pdm
COPY --chown=osm:osm ./lib ./lib
RUN sed -i -e 's/allow_read_prefs": "yes"/allow_read_prefs": "1"/g' ./lib/sendfile_osm_oauth_protector/oauth_cookie_client.py
COPY --chown=osm:osm ./package.json ./package.json
RUN npm install
COPY --chown=osm:osm dockerfiles/docker-entrypoint.sh README.md ./
COPY --chown=osm:osm ./db/ ./db
COPY --chown=osm:osm ./website ./website
COPY --chown=osm:osm ./projects ./projects
RUN chmod +x ./docker-entrypoint.sh \
&& chown -R osm:osm /data/files/pdm \
&& chmod -R 755 /data/files/pdm
COPY --chown=osm:osm ./config.json ./config.json
USER osm
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]