diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..b99e7de969 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.git +.gitignore diff --git a/apps/namadillo/package.json b/apps/namadillo/package.json index b872754791..8838f926bb 100644 --- a/apps/namadillo/package.json +++ b/apps/namadillo/package.json @@ -22,6 +22,7 @@ "framer-motion": "^11.0.28", "idb-keyval": "^6.2.1", "invariant": "^2.2.4", + "io-ts": "^2.2.21", "jotai": "^2.6.3", "jotai-tanstack-query": "^0.8.5", "lodash.debounce": "^4.0.8", diff --git a/apps/namadillo/vite.config.js b/apps/namadillo/vite.config.mjs similarity index 100% rename from apps/namadillo/vite.config.js rename to apps/namadillo/vite.config.mjs diff --git a/docker/namadillo.Dockerfile b/docker/namadillo.Dockerfile new file mode 100644 index 0000000000..9e1c06082d --- /dev/null +++ b/docker/namadillo.Dockerfile @@ -0,0 +1,22 @@ +FROM rust:1.79 as builder +WORKDIR /app +RUN apt update && apt install -y nodejs npm clang pkg-config libssl-dev protobuf-compiler curl +RUN npm install -g yarn +RUN rustup target add wasm32-unknown-unknown +RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y +COPY .yarnrc.yml tsconfig.base.json package.json yarn.lock . +COPY ./.yarn ./.yarn +COPY ./packages ./packages +COPY ./scripts ./scripts +COPY ./apps/namadillo/package.json ./apps/namadillo/package.json +RUN yarn +WORKDIR /app/apps/namadillo +COPY ./apps/namadillo/scripts ./scripts +RUN yarn wasm:build +COPY ./apps/namadillo . +RUN yarn +RUN yarn build + +FROM nginx:alpine +COPY --from=builder /app/apps/namadillo/dist /usr/share/nginx/html +COPY ./docker/namadillo.conf /etc/nginx/conf.d/default.conf diff --git a/docker/namadillo.conf b/docker/namadillo.conf new file mode 100644 index 0000000000..51acaff2fd --- /dev/null +++ b/docker/namadillo.conf @@ -0,0 +1,11 @@ +server { + listen 80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ $uri.html /index.html; + } + gzip on; + gzip_types text/plain text/css application/javascript application/json application/vnd.ms-fontobject application/xml+rss application/atom+xml font/opentype font/ttf image/svg+xml; +} diff --git a/yarn.lock b/yarn.lock index aba8e59e31..5f995094e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8471,6 +8471,7 @@ __metadata: html-webpack-plugin: "npm:^5.5.0" idb-keyval: "npm:^6.2.1" invariant: "npm:^2.2.4" + io-ts: "npm:^2.2.21" jest: "npm:^29.4.1" jest-fetch-mock: "npm:^3.0.3" jotai: "npm:^2.6.3"