Skip to content

Commit

Permalink
chore: compile assets on bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoSimon committed Mar 30, 2024
1 parent b08ba04 commit b6eb79c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions bootstrap_entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/sh
bundle exec rake assets:precompile
bundle exec rails db:prepare
exec $@
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
web:
build:
build:
context: .
volumes:
- .:/app
Expand All @@ -12,23 +12,23 @@ services:
- DATABASE_URL=postgres://postgres:password@db:5432
depends_on:
db:
condition: service_healthy
condition: service_healthy
bootstrap:
condition: service_completed_successfully
command: ["rails", "server", "-b", "0.0.0.0"]
command: [ "rails", "server", "-b", "0.0.0.0" ]

db:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
bootstrap:
build:
build:
context: .
volumes:
- .:/app
Expand All @@ -38,4 +38,4 @@ services:
depends_on:
db:
condition: service_healthy
command: ["bin/rails", "db:prepare"]
entrypoint: ./bootstrap_entrypoint

0 comments on commit b6eb79c

Please sign in to comment.