diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 070d0ba54..aeaef077d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - --allow-multiple-documents exclude: "(data/data_format_geo-entry.yaml)|(deployment/k3s/.*)|(webclient/pnpm-lock.yaml)" - id: check-json + exclude: "(webclient/tsconfig.json)" - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - id: check-case-conflict @@ -57,8 +58,8 @@ repos: rev: 1.7.7 hooks: - id: bandit - args: ["-c", "pyproject.toml"] - additional_dependencies: ["bandit[toml]"] + args: [ "-c", "pyproject.toml" ] + additional_dependencies: [ "bandit[toml]" ] # markdown - repo: https://github.com/DavidAnson/markdownlint-cli2 rev: v0.9.2 diff --git a/webclient/.dockerignore b/webclient/.dockerignore index 1992b6ab8..547277021 100644 --- a/webclient/.dockerignore +++ b/webclient/.dockerignore @@ -1,4 +1,5 @@ -node_modules/* -dist/* -cdn/* -.vscode/* +node_modules +dist +cdn +.output +.nuxt diff --git a/webclient/.eslintrc.cjs b/webclient/.eslintrc.cjs index b34daa501..128333065 100644 --- a/webclient/.eslintrc.cjs +++ b/webclient/.eslintrc.cjs @@ -1,6 +1,4 @@ /* eslint-env node */ -require("@rushstack/eslint-patch/modern-module-resolution"); - module.exports = { root: true, extends: [ diff --git a/webclient/.gitignore b/webclient/.gitignore index 01814ae6d..f01bc4f86 100644 --- a/webclient/.gitignore +++ b/webclient/.gitignore @@ -12,6 +12,8 @@ dist dist-ssr coverage *.local +.nuxt +.output # Editor directories and files .vscode/* diff --git a/webclient/.prettierignore b/webclient/.prettierignore index 15231cfea..b1b163f5e 100644 --- a/webclient/.prettierignore +++ b/webclient/.prettierignore @@ -1 +1,4 @@ tsconfig.json +.output +.nuxt +node_modules diff --git a/webclient/App.vue b/webclient/App.vue deleted file mode 100644 index 5fe63c3b2..000000000 --- a/webclient/App.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/webclient/Dockerfile b/webclient/Dockerfile index a2af89f0d..668cb4031 100644 --- a/webclient/Dockerfile +++ b/webclient/Dockerfile @@ -12,15 +12,19 @@ ARG GIT_COMMIT_SHA ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA} ARG GIT_COMMIT_MESSAGE ENV GIT_COMMIT_MESSAGE=${GIT_COMMIT_MESSAGE} -RUN npm run build-only -RUN gzip --force --keep --recursive ./dist +RUN NITRO_PRESET=deno-server pnpm run build -FROM nginx:1.25 as production-stage -COPY nginx.conf /etc/nginx/nginx.conf -RUN mkdir /app && apt update && apt upgrade -y -COPY --from=build-stage /app/dist /app +FROM denoland/deno:alpine as production-stage +RUN apk update --no-progress --quiet && apk add curl --no-progress --quiet +COPY --from=build-stage /app/.output /app/.output +COPY --from=build-stage /app/node_modules /app/node_modules +COPY --from=build-stage /app/.nuxt /app/.nuxt + +ENV NUXT_HOST=0.0.0.0 +ENV NUXT_PORT=3000 EXPOSE 3000 + HEALTHCHECK CMD curl --fail localhost:3000/health || exit 1 -CMD sh -c "sed -i 's|TILESERVER_URL|${TILESERVER_URL}|g' /etc/nginx/nginx.conf && sed -i 's|CDN_URL|${CDN_URL}|g' /etc/nginx/nginx.conf && sed -i 's|MAIN_API_URL|${MAIN_API_URL}|g' /etc/nginx/nginx.conf && sed -i 's|FEEDBACK_API_URL|${FEEDBACK_API_URL}|g' /etc/nginx/nginx.conf && nginx -g 'daemon off;'" +CMD deno run --unstable --allow-net --allow-read --allow-env /app/.output/server/index.mjs diff --git a/webclient/components/AppFooter.vue b/webclient/components/AppFooter.vue index ed74bb253..ab2816ac0 100644 --- a/webclient/components/AppFooter.vue +++ b/webclient/components/AppFooter.vue @@ -1,16 +1,10 @@