From 3dd62f40dfc20021392966ffddae9ed7825d667b Mon Sep 17 00:00:00 2001 From: xxqfamous Date: Thu, 25 May 2023 11:33:29 +0800 Subject: [PATCH] =?UTF-8?q?docker=E9=83=A8=E7=BD=B2=E6=95=B4=E7=90=86=20?= =?UTF-8?q?=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +++--- docker-compose.yml | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d4781761..5808cbee5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,9 +21,9 @@ RUN touch config/elasticsearch.yml RUN mkdir log RUN /bin/bash -l -c 'bundle install' -RUN /bin/bash -l -c 'RAILS_ENV=production rails db:create' -RUN /bin/bash -l -c 'RAILS_ENV=production bundle exec rake sync_table_structure:import_csv' -RUN /bin/bash -l -c 'RAILS_ENV=production rails db:migrate' +#RUN /bin/bash -l -c 'RAILS_ENV=production rails db:create' +#RUN /bin/bash -l -c 'RAILS_ENV=production bundle exec rake sync_table_structure:import_csv' +#RUN /bin/bash -l -c 'RAILS_ENV=production rails db:migrate' #EXPOSE 4000 #RUN /bin/bash -l -c 'RAILS_ENV=production puma' \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 22c7b5cbc..788bf0a2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,7 +57,12 @@ services: - GITEA_USER=root - GITEA_PWD=gitlink#2023 - GITEA_URL=gitea - command: bash -c "cmd /home/pdl/gitlink && rm -f tmp/pids/server.pid && rails s -p 4000 -b '0.0.0.0'" + 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'" stdin_open: true tty: true # volumes: