Files
sx-fc/Dockerfile
Min Zeya Phyo 98ac443182 Add empty shops.json in Dockerfile for cloud mode
The MyAesCrypt.export_to_file method expects config/shops.json to
exist as a cache of AES keys for tenant lookups. This file is in
.gitignore (runtime-generated) but needs to exist with at least an
empty JSON structure on first boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 23:57:20 +08:00

39 lines
1.0 KiB
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 and runtime files
RUN mkdir -p tmp/pids tmp/puma tmp/cache tmp/sockets log storage public/uploads \
&& echo '{"data":[]}' > config/shops.json
# 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"]