Skip to content

Commit

Permalink
fix: post to ebrains model fix
Browse files Browse the repository at this point in the history
fix: login & fetch user info
feat: history
feat: rotation widget
feat: allow user defined volume
refactor: incoming voxel size, dims optimization
fix: bundled volumes
feat: matomo
fix: use darkmode when necessary
refactor: remove app/ directory
  • Loading branch information
xgui3783 committed Apr 1, 2024
1 parent eb4623f commit 7083c09
Show file tree
Hide file tree
Showing 145 changed files with 1,659 additions and 52,104 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/dockerimg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- staging
- rf_rewriteFrontend

# do not rebuild if...
paths-ignore:
Expand All @@ -30,6 +31,10 @@ jobs:
if [[ $GITHUB_REF == 'refs/heads/staging' ]]; then
echo "DOCKERIMG=voluba:staging" >> "$GITHUB_ENV"
fi
if [[ $GITHUB_REF == 'refs/heads/rf_rewriteFrontend' ]]; then
echo "DOCKERIMG=voluba:rf_rewriteFrontend" >> "$GITHUB_ENV"
fi
- name: 'Setup tags'
run: |
if [[ -z "$DOCKERIMG" ]]
Expand All @@ -40,34 +45,11 @@ jobs:
DOCKER_IMGSTREAM=${{ secrets.EBRAINS_DOCKER_REG_VOLUBA_NSP }}/${DOCKERIMG}
echo "Setting docker image stream to $DOCKER_IMGSTREAM"
echo "DOCKER_IMGSTREAM=$DOCKER_IMGSTREAM" >> $GITHUB_ENV
- name: 'Set matomo env var'
run: |
echo "MATOMO_URL=${{ secrets.MATOMO_URL_PROD }}" >> $GITHUB_ENV
echo "MATOMO_ID=${{ secrets.MATOMO_ID_PROD }}" >> $GITHUB_ENV
- name: 'Set version variable & expmt feature flag'
id: 'setting-vars'
run: |
GIT_HASH=$(git rev-parse --short HEAD)
echo "Setting GIT_HASH: $GIT_HASH"
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_OUTPUT
VERSION=$(jq -r '.version' app/package.json)
echo "Setting VERSION: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
# VUE_APP_ENABLE_EXPERIMENTAL_FEATURES="{}"
- name: 'Build docker image'
run: |
echo "Building $DOCKER_IMGSTREAM"
docker build \
--build-arg MATOMO_URL=$MATOMO_URL \
--build-arg MATOMO_ID=$MATOMO_ID \
--build-arg VUE_APP_BACKEND_URL=${{ secrets.VUE_APP_BACKEND_URL }} \
--build-arg VUE_APP_UPLOAD_URL=${{ secrets.VUE_APP_UPLOAD_URL }} \
-t $DOCKER_IMGSTREAM \
.
echo "Successfully built $DOCKER_IMGSTREAM"
Expand Down
36 changes: 8 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
FROM node:12 as builder

ARG VUE_APP_ALLOW_UPLOAD=true
ARG VUE_APP_BACKEND_URL
ARG VUE_APP_NONLINEAR_BACKEND
ARG VUE_APP_UPLOAD_URL
ARG VUE_APP_DEBUG=false
ARG MATOMO_URL
ARG MATOMO_ID
ARG VUE_APP_ENABLE_EXPERIMENTAL_FEATURES

ENV MATOMO_URL=$MATOMO_URL
ENV MATOMO_ID=$MATOMO_ID
ENV VUE_APP_ALLOW_UPLOAD=$VUE_APP_ALLOW_UPLOAD

ENV VUE_APP_BACKEND_URL=$VUE_APP_BACKEND_URL
ENV VUE_APP_NONLINEAR_BACKEND=$VUE_APP_NONLINEAR_BACKEND
ENV VUE_APP_ENABLE_EXPERIMENTAL_FEATURES=$VUE_APP_ENABLE_EXPERIMENTAL_FEATURES
ENV VUE_APP_UPLOAD_URL=$VUE_APP_UPLOAD_URL
ENV VUE_APP_DEBUG=$VUE_APP_DEBUG

COPY . /frontend
WORKDIR /frontend/app
RUN npm i
FROM node:20 as builder

COPY . /app
WORKDIR /app/frontend
RUN npm i
RUN npm run build

# gzipping container
FROM ubuntu:22.04 as compressor
RUN apt upgrade -y && apt update && apt install brotli

RUN mkdir -p /frontend/app
RUN mkdir -p /app/frontend

# copy frontend
COPY --from=builder /frontend/app/dist /frontend/app/dist
COPY --from=builder /app/frontend/dist /app/frontend/dist

WORKDIR /frontend/app/dist
WORKDIR /app/frontend/dist

RUN for f in $(find . -type f); do gzip < $f > $f.gz && brotli < $f > $f.br; done

Expand All @@ -49,7 +29,7 @@ COPY ./backend/voluba_backend /voluba
RUN chown -R nobody /voluba
WORKDIR /voluba

COPY --from=builder /frontend/app/dist /voluba/public
COPY --from=compressor /app/frontend/dist /voluba/public
ENV PATH_TO_STATIC=/voluba/public

USER nobody
Expand Down
1 change: 0 additions & 1 deletion app/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions app/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions app/babel.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions app/config/dev.env.js

This file was deleted.

76 changes: 0 additions & 76 deletions app/config/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/config/prod.env.js

This file was deleted.

Loading

0 comments on commit 7083c09

Please sign in to comment.