Skip to content

Commit

Permalink
Namadillo: Creating Docker setup (#927)
Browse files Browse the repository at this point in the history
* chore: renaming to .mjs

* feat(namadillo): namadillo docker setup

* fix: adding missing dependency

* feat: adding dockerignore file

* feat: improving caching layers

* feat: updating yarn.lock file
  • Loading branch information
pedrorezende authored Jul 15, 2024
1 parent 552e23c commit 9d78af1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.git
.gitignore
1 change: 1 addition & 0 deletions apps/namadillo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions docker/namadillo.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions docker/namadillo.conf
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9d78af1

Please sign in to comment.