Skip to content

Commit

Permalink
Remove unneeded script utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
christophergeiger3 committed Dec 30, 2022
1 parent 7224707 commit 75ff8f7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 117 deletions.
25 changes: 22 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ COPY ./web /app/web

RUN apt-get update && apt-get install -y curl

ENV VOLTA_HOME=/app/bin/volta
# VOLTA ---
SHELL [ "/bin/bash", "-c" ]
RUN touch /app/bin/bashrc
ENV PROFILE /app/bin/bashrc
ENV BASH_ENV /app/bin/bashrc
ENV VOLTA_HOME /app/bin/volta
ENV PATH $VOLTA_HOME/bin:$PATH
# ---

RUN curl https://get.volta.sh | bash

RUN /app/web/bin/build.sh

FROM mongo:latest as api
Expand All @@ -35,7 +45,15 @@ ENV DATABASE_URL $DATABASE_URL
ENV TEST_DATABASE_URL $TEST_DATABASE_URL
ENV API_URL $API_URL
ENV NODE_ENV $NODE_ENV
ENV VOLTA_HOME=/app/bin/volta

# VOLTA ---
SHELL [ "/bin/bash", "-c" ]
RUN touch /app/bin/bashrc
ENV PROFILE /app/bin/bashrc
ENV BASH_ENV /app/bin/bashrc
ENV VOLTA_HOME /app/bin/volta
ENV PATH $VOLTA_HOME/bin:$PATH
# ---

RUN apt-get update && apt-get install -y ffmpeg python3 curl wget

Expand All @@ -49,7 +67,8 @@ WORKDIR /app/api
RUN /app/api/bin/build.sh

WORKDIR /app/web
RUN /app/web/bin/serve.sh
RUN volta install node@14
RUN volta install serve
EXPOSE 4190 4191

WORKDIR /app
Expand Down
11 changes: 1 addition & 10 deletions api/bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,13 @@ API_BIN=$(dirname "$0")
API_DIR="$API_BIN/.."
APP_BIN="$API_DIR/../bin"

source $APP_BIN/install_volta.sh

install_npm_dependencies() {
install_api_dependencies() {
cd $API_DIR

npm install -g @nestjs/cli
npm install
}

install_api_dependencies() {
check_volta || install_volta
source_volta

install_npm_dependencies
}

build_api() {
npm run build
}
Expand Down
44 changes: 0 additions & 44 deletions bin/install_volta.sh

This file was deleted.

26 changes: 1 addition & 25 deletions bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,8 @@ APP_BIN="$APP_DIR/bin"
WEB_DIR="$APP_DIR/web"
API_DIR="$APP_DIR/api"

export VOLTA_HOME=$VOLTA_HOME
export PATH=$VOLTA_HOME/bin:$PATH

start_web() {
echo volta:
echo $VOLTA_HOME

export VOLTA_HOME=$VOLTA_HOME
export PATH=$VOLTA_HOME/bin:$PATH

cd $WEB_DIR

# echo npm:
# npm --version

# if [[ -x "$(command -v npm)" ]] || [[ -x "$(command -v serve)" ]]; then
# # volta install node
# # volta install npm
# # npm install -g serve
# # echo serve:
# volta install serve
# serve --version
# fi

serve -s dist -l 4191
}

Expand All @@ -47,6 +25,4 @@ main() {
start_api
}

if [[ "${#BASH_SOURCE[@]}" -eq 1 ]]; then
main "$@"
fi
[[ "${#BASH_SOURCE[@]}" -eq 1 ]] && main "$@"
4 changes: 0 additions & 4 deletions web/bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ WEB_DIR="$SCRIPT_DIR/.."
WEB_BIN="$WEB_DIR/bin"
APP_BIN="$WEB_DIR/../bin"

export VOLTA_HOME=$VOLTA_HOME
export PATH=$VOLTA_HOME/bin:$PATH

install_npm_dependencies() {
cd $WEB_DIR
npm install
}

install_web_dependencies() {
$APP_BIN/install_volta.sh
install_npm_dependencies
}

Expand Down
31 changes: 0 additions & 31 deletions web/bin/serve.sh

This file was deleted.

0 comments on commit 75ff8f7

Please sign in to comment.