Skip to content

Commit e296609

Browse files
committed
Update to new ubuntu base image, fix subpaths
1 parent 8dc9621 commit e296609

File tree

6 files changed

+22
-32
lines changed

6 files changed

+22
-32
lines changed

Dockerfile

+14-23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
# Build the react frontend
24
FROM node:18-alpine
35

@@ -13,25 +15,23 @@ COPY viewer/index.html ./index.html
1315
COPY viewer/public ./public
1416
COPY viewer/src ./src
1517

18+
ARG ROOT_PATH=/xreds/
19+
ENV VITE_XREDS_BASE_URL=${ROOT_PATH}
1620
RUN npm run build
1721

1822
# Build the python service layer
1923
FROM public.ecr.aws/b1r9q1p5/rps-matplotlib:latest
2024

2125
# Native dependencies
22-
RUN dnf -y install \
23-
gcc \
24-
gcc-c++ \
25-
make \
26+
RUN apt-get update && apt-get install -y \
2627
git \
27-
gcc-gfortran \
28-
openblas-devel \
29-
geos-devel \
30-
netcdf-devel \
31-
proj-devel \
32-
udunits2-devel \
33-
eccodes-devel
34-
# RUN apt-get install -y git libc-dev gcc g++ libffi-dev build-essential libudunits2-dev libgdal-dev libnetcdf-dev libeccodes-dev libgeos-dev cmake libopenblas-dev
28+
libhdf5-dev \
29+
libopenblas-dev \
30+
libgeos-dev \
31+
libnetcdf-dev \
32+
libproj-dev \
33+
libudunits2-dev \
34+
libeccodes-dev
3535

3636
# Create a folder for the app to live in
3737
RUN mkdir -p /opt/xreds
@@ -64,17 +64,8 @@ COPY --from=0 /opt/viewer/dist ./viewer/dist
6464

6565
# Set the port to run the server on
6666
ENV PORT 8090
67-
ENV ROOT_PATH "/xreds/"
68-
69-
RUN dnf -y remove \
70-
wget \
71-
make \
72-
gcc \
73-
gcc-c++ \
74-
git \
75-
&& dnf autoremove -y \
76-
&& dnf clean dbcache \
77-
&& dnf clean all
67+
ARG ROOT_PATH=/xreds/
68+
ENV ROOT_PATH ${ROOT_PATH}
7869

7970
# Run the webserver
8071
CMD ["sh", "-c", "gunicorn --workers=1 --worker-class=uvicorn.workers.UvicornWorker --log-level=debug --bind=0.0.0.0:${PORT} app:app"]

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ scipy==1.13.0
3535
kerchunk@git+https://github.com/fsspec/kerchunk@8d8e84c619a63d4372b33b05c9bfe35fdcb6e61d
3636
xpublish-opendap@git+https://github.com/xpublish-community/xpublish-opendap@6020c0464f9b7f872f4307dab9d7c97d5d981387
3737
xpublish-wms@git+https://github.com/xpublish-community/xpublish-wms@9574a71405e43c479b7ebcfa1e5d0def04c598d5
38-
xpublish-edr@git+https://github.com/xpublish-community/xpublish-edr@0a4505b30696dec30dc95e0ffe12ea6b598930d7
38+
xpublish-edr@git+https://github.com/xpublish-community/xpublish-edr@019e53acd2e0ad5a1d909d1acfe9863f2e90e51b
3939
opendap-protocol<1.2.0
4040
xarray-subset-grid@git+https://github.com/asascience-open/xarray-subset-grid@81ce464b6357e7353deaaf350ad1be22295d238e

viewer/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc && vite build",
8+
"check": "tsc --noEmit",
9+
"build": "vite build",
910
"preview": "vite preview"
1011
},
1112
"dependencies": {

viewer/src/main.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ const router = createBrowserRouter([
1919
element: <SubsetTool />,
2020
errorElement: <ErrorPage />,
2121
},
22-
]);
22+
], {
23+
basename: import.meta.env.VITE_XREDS_BASE_URL,
24+
});
2325

2426
const queryClient = new QueryClient();
2527

viewer/src/pages/app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ function App() {
418418
{datasets.at(i)?.isFetched && (
419419
<>
420420
<a
421+
target="_blank"
421422
href={`/datasets/${datasetIds.data.at(i)}/`}
422423
>
423424
<MaterialIcon

viewer/src/pages/subset_tool.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ import Map from '../components/map';
66
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
77
import MapboxDraw from '@mapbox/mapbox-gl-draw';
88

9-
import {
10-
useDatasetIdsQuery,
11-
useDatasetMetadataQuery,
12-
useDatasetsQuery,
13-
} from '../query/datasets';
149
import Spinner from '../components/spinner';
1510
import { useQuery } from '@tanstack/react-query';
16-
import MaterialIcon from '../components/material_icon';
1711
import CopyUrl from '../components/copy_url';
1812
import { useSearchParams } from 'react-router-dom';
13+
import { useDatasetIdsQuery } from '../query/datasets';
1914

2015
const useExportThreshold = () =>
2116
useQuery({

0 commit comments

Comments
 (0)