-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (51 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
68 lines (51 loc) · 1.83 KB
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
FROM node:24 AS build_mapproxy
WORKDIR /usr/src/app
COPY . .
# build and compile all python packages required for mapproxy utility
RUN apt-get update
RUN apt-get install python3-pip -y
RUN apt install python3.11-venv -y
RUN apt-get install python3-pil -y python3-yaml python3-pyproj
RUN apt-get install libgeos-dev -y python3-lxml libgdal-dev python3-shapely
RUN apt-get install build-essential -y python3-dev libjpeg-dev zlib1g-dev libfreetype6-dev
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip3 install Pillow==7.0.0
RUN pip3 install MapProxy==1.16.0
RUN pip3 install -r docker/requirements.txt
RUN pip3 install requests==2.27.1
RUN pip3 install uplink
# on future mapproxy >2 will contain the redis.py, loader.py, spec.py fixed patch
RUN cp ./docker/patch/redis.py /opt/venv/lib/python3.11/site-packages/mapproxy/cache/redis.py
FROM node:24 AS mid
WORKDIR /usr/src/app
COPY ./package*.json ./
COPY .husky/ .husky/
RUN npm install
COPY . .
RUN npm run build
FROM node:24-slim AS production
ENV NODE_ENV=production
ENV CONFIG_OFFLINE_MODE=true
# install the application
WORKDIR /usr/src/app
COPY --chown=node:node package*.json ./
COPY --chown=node:node .husky/ .husky/
RUN npm ci --only=production
RUN apt-get update || : && apt-get install python3 -y
RUN apt install dumb-init
RUN apt-get install python3-pil -y
RUN apt-get install -y procps && rm -rf /var/lib/apt/lists/*
COPY --chown=node:node --from=mid /usr/src/app/dist .
COPY --chown=node:node ./config ./config
# set python compiled venv as major
COPY --from=build_mapproxy /opt/venv /opt/venv
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN mkdir -p /mapproxy && \
chown node:node /mapproxy
RUN chmod -R 777 /mapproxy
USER node
EXPOSE 8080
CMD ["dumb-init", "node", "--import", "./instrumentation.mjs", "./index.js"]