Browse Source
* feat: update docker files * CLDC-2531: update docker compose to enforce amd64 and use new port for db * feat: add bundle config in Dockerfile for bundle installs * feat: update bundle install steps in Dockerfile * feat: add nonroot user, update permissions and remove unrequired files in Dockerfile * feat: update remove folder path in Dockerfile * CLDC-2531: update Dockerfile to no longer remove files as it's redundant * Run npx update-browserslist-db@latest * feat: define package versions, add test stage to dockerfile and refactor nonroot user permissions * feat: update docker command for test stage * feat: remove unrequired directories and permissions * feat: remove unrequired staging Dockerfile stage --------- Co-authored-by: Chirag Bhatti <chirag.bhatti@softwire.com> Co-authored-by: Sam Seed <sam.seed@softwire.com>pull/1836/head v0.3.47
Chirag Bhatti
1 year ago
committed by
GitHub
4 changed files with 51 additions and 89 deletions
@ -1,41 +0,0 @@
|
||||
# Build compilation image |
||||
FROM ruby:3.1.4-alpine |
||||
|
||||
# The application runs from /app |
||||
WORKDIR /app |
||||
|
||||
# Add the timezone as it's not configured by default in Alpine |
||||
RUN apk add --update --no-cache tzdata && cp /usr/share/zoneinfo/Europe/London /etc/localtime && echo "Europe/London" > /etc/timezone |
||||
|
||||
RUN apk add --no-cache build-base yarn postgresql-dev git bash |
||||
|
||||
# Install bundler to run bundle exec |
||||
# This should be the same version as the Gemfile.lock |
||||
RUN gem install bundler:2.3.14 --no-document |
||||
|
||||
# Install gems defined in Gemfile |
||||
COPY .ruby-version Gemfile Gemfile.lock /app/ |
||||
|
||||
ARG BUNDLE_FLAGS="--jobs=4 --no-binstubs --no-cache" |
||||
RUN bundle install ${BUNDLE_FLAGS} |
||||
|
||||
# Install node packages defined in package.json, including webpack |
||||
COPY package.json yarn.lock /app/ |
||||
RUN yarn install --frozen-lockfile |
||||
|
||||
# Install gecko driver for Capybara tests |
||||
RUN apk add firefox |
||||
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz \ |
||||
&& tar -xvzf geckodriver-v0.31.0-linux64.tar.gz \ |
||||
&& rm geckodriver-v0.31.0-linux64.tar.gz \ |
||||
&& chmod +x geckodriver \ |
||||
&& mv geckodriver /usr/local/bin/ |
||||
|
||||
# Copy all files to /app (except what is defined in .dockerignore) |
||||
COPY . /app/ |
||||
|
||||
ENV PORT=8080 |
||||
|
||||
EXPOSE ${PORT} |
||||
|
||||
CMD RAILS_ENV=${RAILS_ENV} bundle exec rake db:migrate && bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 |
Loading…
Reference in new issue