diff --git a/Dockerfile b/Dockerfile index 6c20893..f725ab8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,11 +24,9 @@ COPY . ./ # Copy the entrypoint scripts COPY entrypoint.sh ./entrypoint.sh -COPY sidekiq-entrypoint.sh ./sidekiq-entrypoint.sh -COPY rails-entrypoint.sh ./rails-entrypoint.sh # Make sure the entrypoint scripts are executable -RUN chmod +x entrypoint.sh sidekiq-entrypoint.sh rails-entrypoint.sh +RUN chmod +x entrypoint.sh # Precompile assets for production RUN SECRET_KEY_BASE=dummy_key RAILS_ENV=production bundle exec rake assets:precompile @@ -38,3 +36,6 @@ EXPOSE 3000 EXPOSE 6380 ENTRYPOINT ["./entrypoint.sh"] + +# Default command to run the Rails server +CMD bundle exec rails server -b 0.0.0.0 -p 3000 \ No newline at end of file diff --git a/VERSION b/VERSION index 0100a0a..ff04fbf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.18-alpha \ No newline at end of file +1.0.19-alpha \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3b26e9f..5fa7acd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,15 @@ services: - app: + web: build: . + entrypoint: ["./entrypoint.sh"] volumes: + - .:/app - ./storage:/app/storage ports: - "3000:3000" environment: RAILS_ENV: production REDIS_URL: redis://localhost:6380/1 - entrypoint: ["./entrypoint.sh"] command: ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000"] networks: - thinknet diff --git a/entrypoint.sh b/entrypoint.sh index 3b29f07..8f3f629 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,13 @@ if [ -z "$SECRET_KEY_BASE" ]; then export SECRET_KEY_BASE=$(bin/rails secret) fi +echo "Running bundle exec rake assets:precompile" +rm -f /app/tmp/pids/server.pid +echo "Running bundle exec rake assets:precompile" +bundle exec rake assets:precompile RAILS_ENV=production +echo "Running bundle exec rails db:migrate RAILS_ENV=production" +bundle exec rails db:migrate RAILS_ENV=production + # Start Sidekiq worker in the background ./sidekiq-entrypoint.sh & bundle exec sidekiq &