Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ on:
workflow_dispatch: {}
push:
branches: [ main, develop ]
tags: [ "*" ]
paths-ignore:
# - ".github/**"
- ".drone.yml"
- "helm/**"
- "*.md"
- "docs/**"



jobs:
docker-build:
build-openmina-node-image:
runs-on: ubuntu-latest
steps:
- name: Git checkout
Expand All @@ -39,6 +38,9 @@ jobs:
tags: |
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}},event=tag
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push
uses: docker/build-push-action@v5
Expand All @@ -48,3 +50,44 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-openmina-frontend-image:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
openmina/frontend
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}},event=tag
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./frontend
build-args: |
BUILD_CONFIGURATION=compose
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
29 changes: 29 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.8'

services:
openmina_node:
build:
context: ./
dockerfile: Dockerfile
command: [ "node" ]
ports:
- "3000:3000"
environment:
- MINA_SNARK_WORKER_TAG=0.0.9
networks:
- app-network

frontend:
build:
context: ./
dockerfile: Dockerfile_FE
args:
BUILD_CONFIGURATION: local
ports:
- "8070:80"
networks:
- app-network

networks:
app-network:
driver: bridge
20 changes: 3 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
version: '3.8'

services:
openmina_node:
build:
context: ./
dockerfile: Dockerfile
openmina-node:
image: openmina/openmina:${OPENMINA_TAG:-latest}
command: [ "node" ]
ports:
- "3000:3000"
environment:
- MINA_SNARK_WORKER_TAG=0.0.9
networks:
- app-network

frontend:
build:
context: ./
dockerfile: Dockerfile_FE
args:
BUILD_CONFIGURATION: local
image: openmina/frontend:${OPENMINA_FRONTEND_TAG:-latest}
ports:
- "8070:80"
networks:
- app-network

networks:
app-network:
driver: bridge
13 changes: 7 additions & 6 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@
#COPY nginx.conf .
#RUN cat nginx.conf


FROM node:18 AS BUILD_IMAGE
ARG BUILD_CONFIGURATION=production
WORKDIR /app
COPY dist/ ./dist/
COPY nginx.conf .
#RUN npm install
#RUN node_modules/.bin/ng build --configuration production
#RUN npm prune --production
COPY . .
RUN npm install
RUN node_modules/.bin/ng build --configuration ${BUILD_CONFIGURATION}
RUN npm prune --production
RUN [ -f nginx.${BUILD_CONFIGURATION}.conf ] && cp nginx.${BUILD_CONFIGURATION}.conf nginx.conf

FROM nginx:alpine
RUN pwd
RUN ls -l
Expand Down
9 changes: 9 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
}
],
"outputHashing": "all"
},
"compose": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.compose.ts"
}
],
"outputHashing": "all"
}
},
"defaultConfiguration": "production"
Expand Down
47 changes: 47 additions & 0 deletions frontend/nginx.compose.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {

server {
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html index.htm;
error_page 404 /usr/share/nginx/html/index.html;
}

location /openmina-node {
rewrite_log on;
rewrite ^/openmina-node/(.*) /$1 break;
proxy_pass http://openmina-node:3000;
}
}

include /etc/nginx/mime.types;
default_type application/octet-stream;
large_client_header_buffers 4 32k;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

# include /etc/nginx/conf.d/*.conf;
}
22 changes: 22 additions & 0 deletions frontend/src/environments/environment.compose.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { MinaEnv } from '@shared/types/core/environment/mina-env.type';

export const environment: Readonly<MinaEnv> = {
production: false,
identifier: 'Local FE',
globalConfig: {
features: {
dashboard: [],
nodes: ['overview', 'live', 'bootstrap'],
state: ['actions'],
network: ['node-dht', 'graph-overview', 'bootstrap-stats'],
snarks: ['scan-state'],
},
},
configs: [
{
name: 'Compose rust node',
url: '/openmina-node',
},
],
};