Skip to content

Commit

Permalink
switch back to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeragamba committed May 25, 2024
1 parent 3323351 commit 239b9d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 51 deletions.
52 changes: 4 additions & 48 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,8 @@
#!/bin/bash -l
set -e
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Load NVM

set -o allexport
source .env
docker compose -f docker-compose.production.yml build
docker compose -f docker-compose.production.yml up client
docker compose -f docker-compose.production.yml down
docker compose -f docker-compose.production.yml up router -d

echo "=== Entering maintenance mode ==="
cp ./assets/web/deploy.html ./offline.html

echo "=== Updating repo ==="
git pull

echo "=== Updating node ==="

cd og-injector
echo "=== Updating OG Injector ==="
nvm install
corepack enable
yarn install --immutable
cd ..

cd server
echo "=== Updating server ==="
rvm use

bundle config set --local deployment 'true'
bundle config set --local without 'development test'
bundle install

echo "=== Migrating Database ==="
rails db:migrate

bundle exec whenever --update-crontab
cd ..

cd client
echo "=== Updating client ==="
nvm install
corepack enable
yarn install --immutable

echo "=== Building client ==="
yarn build
cd ..

echo "=== Restarting Passenger ==="
passenger-config restart-app $(pwd)

rm ./offline.html
echo "=== All Done ==="
2 changes: 1 addition & 1 deletion router/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx:stable-alpine

COPY ["server.conf", "/etc/nginx/conf.d/default.conf"]
COPY ["nginx.conf", "/etc/nginx/conf.d/default.conf"]
File renamed without changes.
3 changes: 1 addition & 2 deletions server/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ class Application < Rails::Application
config.api_only = true

config.hosts << "server"
# config.hosts << "router"
config.hosts << "localhost"
config.hosts << /(.*\.)?zeragamba\.(ca|com|art)/
config.hosts << /.*\.ngrok\.io/

config.autoload_paths << 'app/views'
config.autoload_paths << 'app/lib'
Expand Down

0 comments on commit 239b9d8

Please sign in to comment.