-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added docker images for namadillo and faucet interface (#1105)
- Loading branch information
Showing
10 changed files
with
255 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Docker 🐳 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
GIT_LFS_SKIP_SMUDGE: 1 | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
images: | ||
- path: "docker/namadillo/Dockerfile" | ||
tag: "namadillo" | ||
- path: "docker/faucet/Dockerfile" | ||
tag: "faucet-interface" | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and Push docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ${{ matrix.images.path }} | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
tags: ${{ matrix.images.tag }}-latest, ${{ matrix.images.tag }}-main | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 | ||
|
||
COPY .yarnrc.yml tsconfig.base.json package.json yarn.lock . | ||
COPY ./.yarn ./.yarn | ||
COPY ./packages ./packages | ||
COPY ./scripts ./scripts | ||
COPY ./apps/faucet/package.json ./apps/faucet/package.json | ||
|
||
RUN yarn | ||
|
||
WORKDIR /app/apps/faucet | ||
|
||
COPY ./apps/faucet . | ||
RUN yarn | ||
RUN yarn build | ||
|
||
FROM nginx:alpine | ||
|
||
COPY --from=builder /app/apps/faucet/build /usr/share/nginx/html | ||
COPY ./docker/faucet/nginx.conf /etc/nginx/conf.d/default.conf |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
FROM rust:1.79 as builder | ||
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 | ||
RUN yarn && yarn build | ||
|
||
FROM nginx:alpine | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/apps/namadillo/dist /usr/share/nginx/html | ||
COPY ./docker/namadillo-nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY ./docker/namadillo.config.tom[l] /usr/share/nginx/html/config.toml | ||
COPY ./docker/namadillo/nginx.conf /etc/nginx/conf.d/default.conf | ||
# COPY ./docker/namadillo/config.tom[l] /usr/share/nginx/html/config.toml | ||
COPY --chmod=0755 ./docker/namadillo/bootstrap_config.sh /docker-entrypoint.d/bootstrap_config.sh | ||
|
||
RUN chown nginx:nginx /docker-entrypoint.d/bootstrap_config.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
CONFIG_PATH="/usr/share/nginx/html/config.toml" | ||
|
||
# if the config.toml file doesn't exist, we create it and we try to populate it from environemnt variables | ||
# Otherwise we try to replace the settings from environemnt variables | ||
if [ ! -f $CONFIG_PATH ]; then | ||
echo "Bootstrapping new configuration file at $CONFIG_PATH" | ||
touch $CONFIG_PATH | ||
if [[ -n $INDEXER_URL ]]; then | ||
echo "indexer_url = \"${INDEXER_URL}\"" >> $CONFIG_PATH | ||
fi | ||
if [[ -n $RPC_URL ]]; then | ||
echo "rpc_url = \"${RPC_URL}\"" >> $CONFIG_PATH | ||
fi | ||
else | ||
echo "Using configuration file at $CONFIG_PATH" | ||
if [[ -n $INDEXER_URL ]]; then | ||
sed -r -i "s~#?indexer_url = .*~indexer_url = \"${INDEXER_URL}\"~g" $CONFIG_PATH | ||
fi | ||
if [[ -n $RPC_URL ]]; then | ||
sed -r -i "s~#?rpc_url = .*~rpc_url = \"${RPC_URL}\"~g" $CONFIG_PATH | ||
fi | ||
cat $CONFIG_PATH | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9c22c2d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://namada-interface-dev.netlify.app as production
🚀 Deployed on https://66e4354f0ce474146be35306--namada-interface-dev.netlify.app