Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated staging dockerfile #1199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@

# Ignore master key for decrypting credentials and more.
/config/master.key
/public/packs
/public/packs-test
# /public/packs
# /public/packs-test
yarn-debug.log*
.yarn-integrity

/test/fixtures/files/seb_key.pem
/test/fixtures/files/seb_pub.pem
/public/packs
/public/packs-test
# /public/packs
# /public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/public/assets/
/public/assets/builds
public/assets/builds/*
app/assets/builds/*
# /public/assets/
# /public/assets/builds
# public/assets/builds/*
# app/assets/builds/*
71 changes: 53 additions & 18 deletions Dockerfile.staging
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
FROM internetee/ruby:3.2.2
ARG RAILS_ENV
ARG SECRET_KEY_BASE
ARG APP_DBHOST
# FROM internetee/ruby:3.2.2
# ARG RAILS_ENV
# ARG SECRET_KEY_BASE
# ARG APP_DBHOST

ENV RAILS_ENV "$RAILS_ENV"
ENV SECRET_KEY_BASE "$SECRET_KEY_BASE"
ENV APP_DBHOST "$APP_DBHOST"
# ENV RAILS_ENV "$RAILS_ENV"
# ENV SECRET_KEY_BASE "$SECRET_KEY_BASE"
# ENV APP_DBHOST "$APP_DBHOST"

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
# # RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
# # RUN apt-get update
# # RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# # RUN apt-get install -y nodejs

# RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# RUN apt-get install -y --no-install-recommends > /dev/null \
# nodejs=* \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*

# RUN npm install -g yarn@latest
# WORKDIR /opt/webapps/app
# # COPY Gemfile Gemfile.lock ./
# # RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5
# # COPY package.json yarn.lock ./
# # RUN yarn install --check-files
# # COPY . .
# # RUN bundle exec rails assets:precompile

# COPY Rakefile Gemfile Gemfile.lock ./
# RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5
# COPY package.json yarn.lock ./
# RUN yarn install --check-files

# RUN bundle exec rails assets:precompile

# EXPOSE 3000

FROM internetee/ruby:3.2.2-refactor as base

RUN npm install -g yarn@latest
WORKDIR /opt/webapps/app
COPY Gemfile Gemfile.lock ./
COPY --link Gemfile Gemfile.lock ./
RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5
COPY package.json yarn.lock ./
RUN yarn install --check-files
COPY . .
RUN bundle exec rails assets:precompile
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile

FROM base

RUN useradd rails
RUN mkdir -p /home/rails && chown rails:rails /home/rails

USER rails:rails

RUN mkdir -p /opt/webapps/app/tmp/pids

COPY --from=base --chown=rails:rails /usr/local/bundle /usr/local/bundle
COPY --from=base --chown=rails:rails /opt/webapps/app /opt/webapps/app

EXPOSE 3000
EXPOSE 3000
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = function(api) {
useBuiltIns: 'entry',
corejs: 3,
modules: false,
loose: true,
exclude: ['transform-typeof-symbol']
}
]
Expand Down
4 changes: 2 additions & 2 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ production:
<<: *default

# Production depends on precompilation of packs prior to booting for performance.
compile: false
compile: true

# Cache manifest.json for performance
cache_manifest: true
Expand All @@ -97,7 +97,7 @@ staging:
<<: *default

# Production depends on precompilation of packs prior to booting for performance.
compile: false
compile: true

# Cache manifest.json for performance
cache_manifest: true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"turbolinks": "^5.2.0",
"typeface-raleway": "^1.1.13",
"url-loader": "^4.1.1",
"ws": "^8.2.1"
"ws": "^8.2.1",
"webpack": "^5.60.0"
},
"babel": {
"presets": [
Expand All @@ -66,7 +67,6 @@
"karma-qunit": "^4.1.2",
"karma-webpack": "^5.0.0",
"qunit": "^2.16.0",
"webpack": "^5.60.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.3.1"
}
Expand Down
Loading
Loading