diff --git a/Dockerfile b/Dockerfile index aaf8784..a5661e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 \ No newline at end of file diff --git a/VERSION b/VERSION index 1ed0e1c..02a9b3d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.3-alpha \ No newline at end of file +1.0.4-alpha \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f78bfa4..6acb998 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: \ No newline at end of file