Files
sx-fc/Dockerfile

38 lines
961 B
Docker

FROM ruby:2.6.10-slim-bullseye
# Install dependencies (MySQL client + ImageMagick for CarrierWave/MiniMagick)
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
nodejs \
git \
curl \
imagemagick \
libmagickwand-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install correct bundler version (must match Gemfile.lock BUNDLED WITH)
RUN gem install bundler:2.4.21
# Install gems
COPY Gemfile Gemfile.lock ./
RUN bundle install --deployment --without development test --jobs 4
# Copy application
COPY . .
# Create required directories
RUN mkdir -p tmp/pids tmp/puma tmp/cache tmp/sockets log storage public/uploads
# Precompile assets
RUN RAILS_ENV=production SECRET_KEY_BASE=placeholder bundle exec rake assets:precompile 2>/dev/null || true
EXPOSE 3000
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
CMD ["/app/entrypoint.sh"]