From b6eb79ccb520bfa4d80e15cb83c4803b22b03e0d Mon Sep 17 00:00:00 2001 From: Eduardo Simon Date: Sat, 30 Mar 2024 01:28:25 +0100 Subject: [PATCH] chore: compile assets on bootstrap --- bootstrap_entrypoint | 4 ++++ docker-compose.yml | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100755 bootstrap_entrypoint diff --git a/bootstrap_entrypoint b/bootstrap_entrypoint new file mode 100755 index 0000000..13bb290 --- /dev/null +++ b/bootstrap_entrypoint @@ -0,0 +1,4 @@ +#! /bin/sh +bundle exec rake assets:precompile +bundle exec rails db:prepare +exec $@ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 204c456..7484bc6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: web: - build: + build: context: . volumes: - .:/app @@ -12,10 +12,10 @@ 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 @@ -23,12 +23,12 @@ services: 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 @@ -38,4 +38,4 @@ services: depends_on: db: condition: service_healthy - command: ["bin/rails", "db:prepare"] + entrypoint: ./bootstrap_entrypoint