Skip to content

Commit b27ac5e

Browse files
author
Test
committed
updates for new 1 app
1 parent eba106b commit b27ac5e

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ COPY . ./
2424

2525
# Copy the entrypoint scripts
2626
COPY entrypoint.sh ./entrypoint.sh
27-
COPY sidekiq-entrypoint.sh ./sidekiq-entrypoint.sh
28-
COPY rails-entrypoint.sh ./rails-entrypoint.sh
2927

3028
# Make sure the entrypoint scripts are executable
31-
RUN chmod +x entrypoint.sh sidekiq-entrypoint.sh rails-entrypoint.sh
29+
RUN chmod +x entrypoint.sh
3230

3331
# Precompile assets for production
3432
RUN SECRET_KEY_BASE=dummy_key RAILS_ENV=production bundle exec rake assets:precompile
@@ -38,3 +36,6 @@ EXPOSE 3000
3836
EXPOSE 6380
3937

4038
ENTRYPOINT ["./entrypoint.sh"]
39+
40+
# Default command to run the Rails server
41+
CMD bundle exec rails server -b 0.0.0.0 -p 3000

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.18-alpha
1+
1.0.19-alpha

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
services:
2-
app:
2+
web:
33
build: .
4+
entrypoint: ["./entrypoint.sh"]
45
volumes:
6+
- .:/app
57
- ./storage:/app/storage
68
ports:
79
- "3000:3000"
810
environment:
911
RAILS_ENV: production
1012
REDIS_URL: redis://localhost:6380/1
11-
entrypoint: ["./entrypoint.sh"]
1213
command: ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000"]
1314
networks:
1415
- thinknet

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ if [ -z "$SECRET_KEY_BASE" ]; then
77
export SECRET_KEY_BASE=$(bin/rails secret)
88
fi
99

10+
echo "Running bundle exec rake assets:precompile"
11+
rm -f /app/tmp/pids/server.pid
12+
echo "Running bundle exec rake assets:precompile"
13+
bundle exec rake assets:precompile RAILS_ENV=production
14+
echo "Running bundle exec rails db:migrate RAILS_ENV=production"
15+
bundle exec rails db:migrate RAILS_ENV=production
16+
1017
# Start Sidekiq worker in the background
1118
./sidekiq-entrypoint.sh &
1219
bundle exec sidekiq &

0 commit comments

Comments
 (0)