forked from geonetwork/geonetwork-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This dockerfile should work for all traditional apps, | ||
# i.e. it only sets up a nginx server with the app dist folder | ||
|
||
FROM nginx:1.24-alpine | ||
|
||
ARG APP_NAME="search" | ||
ENV APP_NAME=${APP_NAME} | ||
ENV GN4_API_URL "" | ||
ENV PROXY_PATH "" | ||
ENV CONFIG_DIRECTORY_OVERRIDE "" | ||
ENV ASSETS_DIRECTORY_OVERRIDE "" | ||
ENV CUSTOM_SCRIPTS_DIRECTORY "" | ||
|
||
COPY dist/apps/${APP_NAME} /usr/share/nginx/html/${APP_NAME} | ||
COPY tools/docker/docker-entrypoint.sh / | ||
|
||
# copy Web Components HTML embedder as a bonus | ||
COPY tools/webcomponent/wc-embedder.html /usr/share/nginx/html/${APP_NAME} | ||
|
||
# copy default NGINX conf & put the app name in it | ||
COPY tools/docker/nginx.ign.conf /etc/nginx/conf.d/default.conf | ||
RUN sed -i "s/APP_NAME/${APP_NAME}/" /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["sh", "/docker-entrypoint.sh", "nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
|
||
root /usr/share/nginx/html/datahub; | ||
|
||
server_tokens off; | ||
|
||
location ~ /index.html|.*\.toml|.*\.json$ { | ||
expires -1; | ||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
} | ||
|
||
location ~ .*\.css$|.*\.js$ { | ||
add_header Cache-Control 'max-age=86400'; # 24h | ||
} | ||
|
||
location / { | ||
try_files $uri$args $uri$args/ /index.html; | ||
|
||
add_header Cache-Control 'max-age=86400'; # 24h | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} | ||
|