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

Don't install development and test gems in production #8

Merged
merged 1 commit into from Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -7,6 +7,7 @@ ARG DB_USER=root
ARG DB_PASS=root
ARG SECRET_KEY_BASE="fakekeybase"
ARG DB_NAME=root
ARG BUNDLE_WITHOUT=""

# required for certain linting tools that read files, such as erb-lint
ENV LANG='C.UTF-8' \
Expand All @@ -23,9 +24,8 @@ RUN apk add --no-cache --virtual .build-deps build-base && \
apk add --no-cache nodejs yarn mysql-dev bash make

COPY Gemfile Gemfile.lock .ruby-version ./
ARG BUNDLE_INSTALL_FLAGS
RUN bundle config set no-cache 'true' && \
bundle install ${BUNDLE_INSTALL_FLAGS}
bundle install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we're removing this here? We set it in docker-compose to speed up the installation by running it in parallel using the jobs flag (BUNDLE_INSTALL_FLAGS: "${BUNDLE_INSTALL_FLAGS:- --jobs 20 --retry 5}")


COPY package.json yarn.lock ./
RUN yarn && yarn cache clean
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -8,7 +8,7 @@ endif
DOCKER_BUILD_CMD = BUNDLE_INSTALL_FLAGS="$(BUNDLE_FLAGS)" $(DOCKER_COMPOSE) build

build:
docker build -t docker_admin . --build-arg RACK_ENV --build-arg DB_HOST --build-arg DB_USER --build-arg DB_PASS --build-arg SECRET_KEY_BASE --build-arg DB_NAME
docker build -t docker_admin . --build-arg RACK_ENV --build-arg DB_HOST --build-arg DB_USER --build-arg DB_PASS --build-arg SECRET_KEY_BASE --build-arg DB_NAME --build-arg BUNDLE_WITHOUT

build-dev:
$(DOCKER_COMPOSE) build
Expand Down
1 change: 1 addition & 0 deletions buildspec.yml
Expand Up @@ -5,6 +5,7 @@ env:
DB_PORT: 3306
RACK_ENV: "production"
ENV: ${ENV}
BUNDLE_WITHOUT: "test development"
parameter-store:
DB_USER: "/codebuild/dhcp/$ENV/admin/db/username"
DB_PASS: "/codebuild/dhcp/$ENV/admin/db/password"
Expand Down