Skip to content

Commit

Permalink
feat(namadillo): namadillo docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende committed Jul 12, 2024
1 parent 7d36081 commit 35c12dd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docker/namadillo.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 .
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
17 changes: 17 additions & 0 deletions docker/namadillo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
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;
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff2?|ttf|eot)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
}

0 comments on commit 35c12dd

Please sign in to comment.