Skip to content

Commit

Permalink
fix: add needed fix after contest
Browse files Browse the repository at this point in the history
  • Loading branch information
mickamy committed Jan 2, 2024
1 parent 04c3031 commit 31494a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker/app/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -eux

sudo service nginx start
sudo service mysql start
sudo service mysql start || true # なぜか失敗する(調査中)
sudo chown -R mysql:mysql /var/lib/mysql /var/run/mysqld
sudo service mysql start # 正しく起動
sudo mysql -u root -pishocon -e 'CREATE DATABASE IF NOT EXISTS ishocon2;' && \
Expand Down
11 changes: 8 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ then
exit 1
fi

check_message="start application w/ ${app_lang}..."

source /home/ishocon/.bashrc

echo "app_lang: $app_lang"

function make_tmp_file() {
touch /tmp/ishocon-app
echo "$check_message"
}

function run_ruby() {
cd "/home/ishocon/webapp/$app_lang"
sudo rm -rf /tmp/unicorn.pid
make_tmp_file
# add sudo for .pid file is not created somehow because of permission denied
sudo unicorn -c unicorn_config.rb
unicorn -c unicorn_config.rb
}

function run_python() {
Expand All @@ -40,8 +45,8 @@ function run_php() {
cd "/home/ishocon/webapp/$app_lang"
sudo mv -f /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
sudo cp /home/ishocon/webapp/php/php-nginx.conf /etc/nginx/nginx.conf
sudo service nginx reload
make_tmp_file
sudo service nginx reload
tail -f /dev/null
}

Expand Down
2 changes: 1 addition & 1 deletion webapp/ruby/unicorn_config.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
worker_processes 2
preload_app true
pid './unicorn.pid'
pid '/tmp/unicorn.pid'
listen 8080

0 comments on commit 31494a6

Please sign in to comment.