diff --git a/bin/start.sh b/bin/start.sh new file mode 100644 index 000000000..306a42730 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +bash -l -c "source /etc/profile.d/rvm.sh" +bash -c "RAILS_ENV=production rails db:create" +bash -c "RAILS_ENV=production bundle exec rake sync_table_structure:import_csv" +bash -c "RAILS_ENV=production rails db:migrate" +bash -c "rm -f tmp/pids/server.pid && rails s -p 4000 -b '0.0.0.0'" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1f8da5f3b..5944a4df1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,15 +58,12 @@ services: - GITEA_PWD=gitlink#2023 #GITEA_PWD from gitea/start.sh - GITEA_URL=gitea command: - - bash -l -c "source /etc/profile.d/rvm.sh" - - bash -c "RAILS_ENV=production rails db:create" - - bash -c "RAILS_ENV=production bundle exec rake sync_table_structure:import_csv" - - bash -c "RAILS_ENV=production rails db:migrate" - - bash -c "cmd /home/pdl/gitlink && rm -f tmp/pids/server.pid && rails s -p 4000 -b '0.0.0.0'" + - 'bash' + - '/start.sh' stdin_open: true tty: true -# volumes: -# - .:/home/app/gitlink + volumes: + - ./bin/start.sh:/start.sh ports: - "4000:4000" depends_on: diff --git a/gitea/start.sh b/gitea/start.sh index be893e3e4..853da6340 100644 --- a/gitea/start.sh +++ b/gitea/start.sh @@ -1,5 +1,5 @@ #!/bin/bash cp /gitea_hat/gitea_hat /usr/local/bin/gitea -/usr/local/bin/gitea admin user create --username root --password gitlink#2023 --email root@example.org --config /etc/gitea/app.ini +/usr/local/bin/gitea web --config /etc/gitea/app.ini -/usr/local/bin/gitea web --config /etc/gitea/app.ini \ No newline at end of file +/usr/local/bin/gitea admin user create --username root --password gitlink#2023 --email root@example.org --config /etc/gitea/app.ini \ No newline at end of file