Skip to content

Commit

Permalink
fix: cesium workers cache nginx location config
Browse files Browse the repository at this point in the history
  • Loading branch information
assafchamoy committed Oct 29, 2023
1 parent 13903d2 commit fc0e932
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ FROM nginx:1.19.1-alpine AS production
# Install Node for running confd
RUN set -eux & apk add --no-cache nodejs
#change nginx config to work without root
RUN sed -i 's/listen 80;/listen 8080;/g' /etc/nginx/conf.d/default.conf && \
RUN sed -i 's#listen 80;#listen 8080;#g' /etc/nginx/conf.d/default.conf && \
sed -i 's#index index.html index.htm;#index index.html index.htm;\n location ~ /Cesium/Workers/.*js$ {\n expires -1;\n add_header "Cache-Control" "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";\n }#g' /etc/nginx/conf.d/default.conf && \
sed -i '/user nginx;/d' /etc/nginx/nginx.conf && \
sed -i 's,/var/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf && \
sed -i "/^http {/a \ server_tokens off;\n proxy_temp_path /tmp/proxy_temp;\n client_body_temp_path /tmp/client_temp;\n fastcgi_temp_path /tmp/fastcgi_temp;\n uwsgi_temp_path /tmp/uwsgi_temp;\n scgi_temp_path /tmp/scgi_temp;\n" /etc/nginx/nginx.conf
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3'

services:

discrete-layer-client-service:

image: acrarolibotnonprod.azurecr.io/discrete-layer-client:v2.4.6

build: .

container_name: discrete-layer-client-container

ports:
- 3000:8080

environment:
PUBLIC_URL: '.'
MAP_CENTER: '[34.817, 31.911]'
MAP_ZOOM: 14
BASE_MAPS: '{ "maps": [ { "id": "1st", "title": "1st Map", "isCurrent": false, "thumbnail": "https://nsw.digitaltwin.terria.io/build/3456d1802ab2ef330ae2732387726771.png", "baseRasteLayers": [ { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "INFRARED_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?", "layers": "goes_conus_ir", "credit": "Infrared data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } } ], "baseVectorLayers": [] }, { "id": "2nd", "title": "2nd Map", "thumbnail": "https://nsw.digitaltwin.terria.io/build/efa2f6c408eb790753a9b5fb2f3dc678.png", "baseRasteLayers": [ { "id": "RADAR_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?", "layers": "nexrad-n0r", "credit": "Radar data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } }, { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "VECTOR_TILES_GPS", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 2, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ], "baseVectorLayers": [] }, { "id": "3rd", "title": "3rd Map", "thumbnail": "https://nsw.digitaltwin.terria.io/build/d8b97d3e38a0d43e5a06dea9aae17a3e.png", "baseRasteLayers": [ { "id": "VECTOR_TILES", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38", "layers": "", "credit": "thunderforest" } }, { "id": "VECTOR_TILES_GPS_1", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 1, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ], "baseVectorLayers": [] }, { "id": "4th", "title": "4th Map", "isCurrent": true, "thumbnail": "https://nsw.digitaltwin.terria.io/build/3456d1802ab2ef330ae2732387726771.png", "baseRasteLayers": [ { "id": "ARTZI_MZ-OrthophotoBest", "type": "WMTS_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://raster-mapproxy-int-nginx-route-integration.apps.j1lk3njp.eastus.aroapp.io/api/raster/v1/wmts/ARTZI_MZ-OrthophotoBest/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.jpeg?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJkIjpbInJhc3RlciIsInJhc3RlcldtcyIsInJhc3RlckV4cG9ydCIsImRlbSIsInZlY3RvciIsIjNkIl0sImlhdCI6MTY3NDYzMjM0Niwic3ViIjoibWFwY29sb25pZXMtYXBwIiwiaXNzIjoibWFwY29sb25pZXMtdG9rZW4tY2xpIn0.D1u28gFlxf_Z1bzIiRHZonUgrdWwhZy8DtmQj15cIzaABRUrGV2n_OJlgWTuNfrao0SbUZb_s0_qUUW6Gz_zO3ET2bVx5xQjBu0CaIWdmUPDjEYr6tw-eZx8EjFFIyq3rs-Fo0daVY9cX1B2aGW_GeJir1oMnJUURhABYRoh60azzl_utee9UdhDpnr_QElNtzJZIKogngsxCWp7tI7wkTuNCBaQM7aLEcymk0ktxlWEAt1E0nGt1R-bx-HnPeeQyZlxx4UQ1nuYTijpz7N8poaCCExOFeafj9T7megv2BzTrKWgfM1eai8srSgNa3I5wKuW0EyYnGZxdbJe8aseZg", "layer": "ARTZI_MZ-OrthophotoBest", "style": "default", "format": "image/jpeg", "tileMatrixSetID": "newGrids" } } ], "baseVectorLayers": [] } ] }'
DEFAULT_TERRAIN_PROVIDER_URL: ''
MAP_SERVICE_RASTER_URL: ''
SERVICE_PROTOCOL: 'http://'
SERVICE_NAME: 'localhost:8080/graphql'
restart: unless-stopped

0 comments on commit fc0e932

Please sign in to comment.