Deployed app layout is broken.

I am Japanese. Sorry if my English is poor.

The layout of my deployed app is broken.
I did a lot of research on my own, but I could not solve the problem.
I am using Rails 7.0.4, Ruby 3.1.2, Tailwindcss and daisyUI.

I’m thinking it’s due to it not being compiled. However, I have looked and found no clues.

Below is the source code.
If you have any possible causes, please let me know.
Also, please let me know if you have any source code that you would like me to add.
I am really struggling and would be very grateful for your help.

  • Dockerfile
# syntax = docker/dockerfile:1

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
FROM ruby:$RUBY_VERSION-slim as base

# Rails app lives here
WORKDIR /rails

# Set production environment
ENV RAILS_ENV="production" \
    BUNDLE_WITHOUT="development:test" \

# Update gems and bundler
RUN gem update --system --no-document && \
    gem install -N bundler

# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build gems and node modules
RUN apt-get update -qq && \
    apt-get install --no-install-recommends -y build-essential curl libpq-dev node-gyp pkg-config python-is-python3

# Install JavaScript dependencies
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL | tar xz -C /tmp/ && \
    /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
    npm install -g yarn@$YARN_VERSION && \
    rm -rf /tmp/node-build-master

# Install application gems
COPY --link Gemfile Gemfile.lock ./
RUN bundle install && \
    bundle exec bootsnap precompile --gemfile && \
    rm -rf ~/.bundle/ $BUNDLE_PATH/ruby/*/cache $BUNDLE_PATH/ruby/*/bundler/gems/*/.git

# Install node modules
COPY --link package.json package-lock.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Copy application code
COPY --link . .

# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile app/ lib/

# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile
RUN rm -f /rails/tmp/pids/

# Final stage for app image
FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
    apt-get install --no-install-recommends -y postgresql-client && \
    rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Run and own the application files as a non-root user for security
RUN useradd rails --home /rails --shell /bin/bash
USER rails:rails

# Copy built artifacts: gems, application
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=rails:rails /rails /rails

# Deployment options

# Entrypoint prepares the database.
ENTRYPOINT ["/rails/bin/docker-entrypoint"]

# Start the server by default, this can be overwritten at runtime
CMD ["./bin/rails", "server"]
  • package.json
  "name": "sample_app",
  "version": "1.0.0",
  "main": "index.js",
  "repository": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
  "author": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
  "license": "MIT",
  "dependencies": {
    "@hotwired/stimulus": "^3.2.1",
    "tom-select": "^2.2.2"
  "scripts": {
    "build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/tailwind.css"
  "packageManager": "yarn@1.22.19"


source ""
git_source(:github) { |repo| "{repo}.git" }
ruby "3.1.2"
gem "rails", "~> 7.0.4", ">="

# The original asset pipeline for Rails []
gem "sprockets-rails"

# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"

# Use the Puma web server []
gem "puma", "~> 5.0"

# Use JavaScript with ESM import maps []
gem "importmap-rails"

# Hotwire's SPA-like page accelerator []
gem "turbo-rails"

# Hotwire's modest JavaScript framework []
gem "stimulus-rails"

# Build JSON APIs with ease []
gem "jbuilder"

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis []
# gem "kredis"

# Use Active Model has_secure_password []
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Use Sass to process CSS
gem "sassc-rails"

gem 'sorcery'
gem 'rails-i18n'
gem 'cssbundling-rails'
gem "tailwindcss-rails"
gem 'google-api-client', '~> 0.11'
gem 'jquery-rails'
gem "simple_calendar", "~> 2.4"
gem "administrate"

# LINE Messaging API SDK
gem 'line-bot-api'

gem 'config'

gem "meta-tags"

group :development, :test do
  gem "debug", platforms: %i[ mri mingw x64_mingw ]
  gem 'pry-byebug'
  gem 'pry-rails'
  # Code analize
  gem 'bullet'
  gem 'rubocop', require: false
  gem 'rubocop-rails', require: false
  gem 'rubocop-rspec', require: false
  gem 'rubocop-performance', require: false
  gem 'rspec-rails'
  gem 'factory_bot_rails'
  gem 'faker'

group :development do
  gem "web-console"
  gem 'letter_opener_web'

group :test do
  # Use system testing []
  gem "capybara"
  gem "selenium-webdriver"
  gem "webdrivers"

group :production do #本番環境
  gem "dockerfile-rails", ">= 1.2"
  • config/tailwind.config.js
module.exports = {
  content: [
    "../myapp/**/*.{html.erb, html, js}",
  theme: {
      extend: {
        colors: {
  plugins: [
  daisyui: {
    themes: [
  • .yarnrc
# yarn lockfile v1

yarn-path ".yarn/releases/yarn-1.22.19.cjs"
  • .dockerignore
# See for more about ignoring files.

# Ignore git directory.

# Ignore bundler config.

# Ignore all default key files.

# Ignore all environment files.

# Ignore all logfiles and tempfiles.

# Ignore pidfiles, but keep the directory.

# Ignore storage (uploaded files in development and any SQLite databases).

# Ignore assets.

Can you check your browser console? Does it have some errors, like missing files? The below is for Chrome, but almost all browsers have some nowadays.

Since your application is at least running, sharing the URL of your application may be another way to show us what’s going on there.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.