Skip to content

Commit

Permalink
switch back to entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
Test committed Sep 13, 2024
1 parent 39c2975 commit ce935b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM ruby:3.2.2

# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs yarn libsqlite3-dev
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client libsqlite3-dev build-essential

# Set the working directory in the container
WORKDIR /app
Expand All @@ -16,6 +16,12 @@ RUN bundle install
# Copy the application code
COPY . ./

# Ensure the entrypoint scripts are included in the image
COPY entrypoint.sh ./entrypoint.sh
COPY sidekiq-entrypoint.sh ./sidekiq-entrypoint.sh

# Set a dummy SECRET_KEY_BASE for precompilation
# Make sure the entrypoint scripts are executable
RUN chmod +x entrypoint.sh sidekiq-entrypoint.sh

# Define the default command to be run in the container
RUN SECRET_KEY_BASE=dummy_key RAILS_ENV=production bundle exec rake assets:precompile
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3-alpha
1.0.4-alpha
26 changes: 8 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
services:
web:
build: .
command: bash -c "
export REDIS_URL=redis://redis:6379/1 &&
export SECRET_KEY_BASE=$(bin/rails secret) &&
rm -f tmp/pids/server.pid &&
bundle exec rake assets:precompile &&
bundle exec rails db:migrate &&
bundle exec rails server -b 0.0.0.0 -p 3000"
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server -b 0.0.0.0 -p 3000"
entrypoint: ["./entrypoint.sh"]
volumes:
- .:/app
- ./storage:/app/storage
ports:
- "3000:3000"
environment:
RAILS_ENV: production
RAILS_ENV: development
REDIS_URL: redis://redis:6379/1
depends_on:
- redis

worker:
build: .
command: bash -c "
export REDIS_URL=redis://redis:6379/1 &&
export SECRET_KEY_BASE=$(bin/rails secret) &&
rm -f tmp/pids/server.pid &&
bundle exec rails db:migrate &&
bundle exec sidekiq"
command: bundle exec sidekiq
entrypoint: ["./sidekiq-entrypoint.sh"]
volumes:
- .:/app
- ./storage:/app/storage
environment:
RAILS_ENV: production
REDIS_URL: redis://redis:6379/1
RAILS_ENV: development
depends_on:
- redis

redis:
image: redis:7.2.5
image: redis:6.2.5
ports:
- "6379:6379"

volumes:
db-data:
db-data:

0 comments on commit ce935b7

Please sign in to comment.