From 1fd63d37565932c1e335a494f7f334558eb1ad02 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 13 Aug 2021 15:54:56 -0400 Subject: [PATCH] all for setting rails env --- .github/workflows/deploy.yml | 4 +++- Dockerfile-prod | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0ae38f954..cedbaf866 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -83,6 +83,8 @@ jobs: builder: ${{ steps.buildx.outputs.name }} build-args: | DEVISE_SECRET=${{ env.DEVISE_SECRET }} + RAILS_ENV=production + NODE_ENV=production push: false load: true # target: development @@ -93,7 +95,7 @@ jobs: - name: Run specs run: | docker run -d --name="test-database" --hostname "postgres" -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" postgres:latest - docker run --network "container:test-database" -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" $CONTAINER_TEST_REPOSITORY /bin/sh -c "bundle exec rake db:create db:structure:load; bundle exec rspec" + docker run --network "container:test-database" -e RAILS_ENV=test -e DEVISE_SECRET=${{ env.DEVISE_SECRET }} -e "POSTGRES_PASSWORD=test" $CONTAINER_TEST_REPOSITORY /bin/sh -c "bundle exec rake db:create db:structure:load; bundle exec rspec" # The docker pull does not work - name: Run security tests diff --git a/Dockerfile-prod b/Dockerfile-prod index 4f58f3afb..9cb4c5896 100644 --- a/Dockerfile-prod +++ b/Dockerfile-prod @@ -7,8 +7,8 @@ FROM --platform=linux/x86_64 ruby:2.7.2-alpine as base ENV LANG C.UTF-8 # ensure that the encoding is UTF8 ENV LANGUAGE C.UTF-8 # ensure that the encoding is UTF8 -ENV RAILS_ENV production -ENV NODE_ENV production +ARG RAILS_ENV=production +ARG NODE_ENV=production # Use a persistent volume for the gems installed by the bundler ENV BUNDLE_PATH /var/bundler