Skip to content

Commit

Permalink
updates for new 1 app
Browse files Browse the repository at this point in the history
  • Loading branch information
Test committed Sep 20, 2024
1 parent eba106b commit b27ac5e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.18-alpha
1.0.19-alpha
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down

0 comments on commit b27ac5e

Please sign in to comment.