-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
128 lines (94 loc) · 4.44 KB
/
Copy pathDockerfile
File metadata and controls
128 lines (94 loc) · 4.44 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
ARG GEOMAPFISH_VERSION
ARG GEOMAPFISH_MAIN_MINOR_VERSION
FROM ghcr.io/camptocamp/geomapfish-tools:${GEOMAPFISH_VERSION} AS builder
ENV VARS_FILE=vars.yaml
ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqlalchemy.max_overflow \
sqlalchemy.executemany_mode sqlalchemy_slave.url sqlalchemy_slave.pool_recycle sqlalchemy_slave.pool_size \
sqlalchemy_slave.max_overflow sqlalchemy_slave.executemany_mode schema schema_static enable_admin_interface \
default_locale_name servers layers cache admin_interface getitfixed functionalities \
raster shortener hide_capabilities tinyowsproxy resourceproxy print_url print_get_redirect \
checker check_collector default_max_age package srid \
reset_password fulltextsearch global_headers headers authorized_referers hooks stats db_chooser \
dbsessions urllogin host_forward_host headers_whitelist headers_blacklist \
smtp c2c.base_path welcome_email feedback altcha \
lingva_extractor interfaces_config interfaces devserver_url api authentication intranet metrics pdfreport \
vector_tiles i18next main_ogc_server static_files http_options
COPY . /tmp/config/
ARG SIMPLE
ENV SIMPLE=$SIMPLE
RUN build-l10n "geomapfish"
ARG PGSCHEMA
ENV PGSCHEMA=$PGSCHEMA
RUN \
cd /tmp/config/geoportal/ \
&& [ "${SIMPLE}" == "TRUE" ] || rm -f geomapfish_geoportal/*.py \
&& c2c-template --vars ${VARS_FILE} \
--get-config geomapfish_geoportal/config.yaml \
${CONFIG_VARS} \
&& pykwalify --data-file geomapfish_geoportal/config.yaml \
--schema-file CONST_config-schema.yaml \
&& rm CONST_* vars.yaml \
&& qgisserver-plugin-config geomapfish_geoportal/config.yaml ../qgisserver/geomapfish.yaml.tmpl
###############################################################################
FROM ghcr.io/camptocamp/geomapfish-config:${GEOMAPFISH_MAIN_MINOR_VERSION} AS gmf_config
ARG PGSCHEMA
ENV PGSCHEMA=$PGSCHEMA
COPY --from=builder /tmp/config/ /tmp/config/
RUN \
mvif /tmp/config/mapserver /etc/ \
&& mvif /tmp/config/tilegeneration /etc/ \
&& mvif /tmp/config/qgisserver /etc/qgisserver \
&& mvif /tmp/config/haproxy/* /etc/haproxy/ \
&& mkdir --parent /usr/local/tomcat/webapps/ROOT/ \
&& mvif /tmp/config/print /tmp/config/print/print-apps /usr/local/tomcat/webapps/ROOT/ \
&& mv /tmp/config/geoportal/geomapfish_geoportal/ /etc/geomapfish/ \
&& ( mv /tmp/config/geoportal/* /etc/geomapfish/ || true ) \
&& chmod g+w -R \
/etc/geomapfish \
/etc/mapserver \
/etc/qgisserver \
/etc/tilegeneration \
/usr/local/tomcat/webapps/ROOT/print-apps \
/etc/haproxy_dev \
/etc/haproxy \
&& adduser www-data root \
&& sed 's#bind :80#bind *:443 ssl crt /etc/haproxy_dev/localhost.pem#g' /etc/haproxy/haproxy.cfg.tmpl \
> /etc/haproxy_dev/haproxy.cfg.tmpl \
&& echo ' http-request set-header X-Forwarded-Proto https' >> /etc/haproxy_dev/haproxy.cfg.tmpl
VOLUME /etc/geomapfish \
/etc/mapserver \
/etc/qgisserver \
/etc/tilegeneration \
/usr/local/tomcat/webapps/ROOT/print-apps \
/etc/haproxy_dev \
/etc/haproxy
###############################################################################
FROM node:22-slim AS webcomponent-build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install --ignore-scripts
COPY tsconfig.json vite.config.ts ./
COPY webcomponents/ ./webcomponents/
RUN NODE_ENV=production npm run build
###############################################################################
FROM node:22-slim AS ui-build
WORKDIR /app
COPY ui/package.json ui/package-lock.json ./
RUN npm install --ignore-scripts
COPY ui/ ./
RUN NODE_ENV=production npm run build
###############################################################################
FROM node:22-slim AS geogirafe-build
WORKDIR /app
COPY geogirafe/package.json geogirafe/package-lock.json ./
RUN npm install --ignore-scripts
COPY geogirafe/ ./
ARG VISIBLE_ENTRY_POINT="/"
RUN NODE_ENV=production npm run build -- --base=${VISIBLE_ENTRY_POINT}static-frontend/geogirafe/
###############################################################################
FROM gmf_config AS config
COPY --from=webcomponent-build /app/dist/ /etc/geomapfish/static/custom/
COPY --from=ui-build /app/dist/* /etc/static-frontend/
COPY --from=ui-build /app/node_modules/ngeo/dist/fa-* /etc/static-frontend/
COPY --from=geogirafe-build /app/dist/app /etc/static-frontend/geogirafe
VOLUME /etc/static-frontend/