Add Docker deployment files for Unity infrastructure migration
This commit is contained in:
54
Dockerfile
54
Dockerfile
@@ -1,20 +1,34 @@
|
||||
FROM ruby:2.5
|
||||
RUN apt-get update -qq && apt-get install -y build-essential libmariadb-dev libcups2-dev libpq-dev nodejs tzdata
|
||||
RUN mkdir /sxrestaurant
|
||||
RUN mkdir -p /sxrestaurant/tmp/puma
|
||||
ENV RAILS_ENV production
|
||||
ENV RACK_ENV production
|
||||
WORKDIR /sxrestaurant
|
||||
#RUN gem install bundler
|
||||
#COPY Gemfile /sxrestaurant/Gemfile
|
||||
#COPY Gemfile.lock /sxrestaurant/Gemfile.lock
|
||||
#RUN bundle install --without development test
|
||||
RUN echo "Asia/Rangoon" > /etc/timezone
|
||||
RUN dpkg-reconfigure -f noninteractive tzdata
|
||||
RUN date
|
||||
COPY . /sxrestaurant
|
||||
RUN gem install bundler
|
||||
#RUN bundle update --bundler
|
||||
RUN bundle install --without development test
|
||||
RUN bundle exec rake assets:precompile
|
||||
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
|
||||
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 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"]
|
||||
|
||||
Reference in New Issue
Block a user