diff --git a/Dockerfile b/Dockerfile index f6d6087b3..59d5e94e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,8 @@ RUN su app -s /bin/bash -c "bundle install --path /opt/vendor/bundle" # Copy the main application. COPY . $APP_HOME -RUN chown -R app:app /home/app +RUN chown -R app:app /home/app && \ + mv config/database.yml.example config/database.yml USER app RUN bundle exec rake tmp:create assets:precompile diff --git a/config/charts/barong/templates/_helpers.tpl b/config/charts/barong/templates/_helpers.tpl index 823c950e1..790ea8827 100644 --- a/config/charts/barong/templates/_helpers.tpl +++ b/config/charts/barong/templates/_helpers.tpl @@ -37,7 +37,7 @@ It is pre-install hook, so we don't have secrets created yet and we need to use - name: COOKIES_SECRET_KEY value: "" {{- if .Values.db.password }} -- name: DATABASE_PASS +- name: DATABASE_PASSWORD value: {{ .Values.db.password }} {{- end }} {{- end -}} @@ -66,7 +66,7 @@ Environment for barong container name: {{ template "fullname" . }} key: cookiesSecretKey {{- if .Values.db.password }} -- name: DATABASE_PASS +- name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: {{ template "fullname" . }} diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index f424c1641..000000000 --- a/config/database.yml +++ /dev/null @@ -1,21 +0,0 @@ -default: &default - adapter: mysql2 - encoding: utf8 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - username: root - password: - host: localhost - -development: - <<: *default - database: barong_development - -test: - <<: *default - database: barong_test - -production: - <<: *default - database: <%= ENV['DATABASE_NAME'] %> - username: <%= ENV['DATABASE_USER'] %> - password: <%= ENV['DATABASE_PASS'] %> diff --git a/config/database.yml.example b/config/database.yml.example index 35eb88862..7aab306e9 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -1,10 +1,10 @@ default: &default - adapter: mysql2 + adapter: mysql2 encoding: utf8 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root - password: root - host: localhost + password: + host: localhost development: <<: *default @@ -16,6 +16,6 @@ test: production: <<: *default - database: barong_production - username: barong - password: <%= ENV['BARONG_DATABASE_PASSWORD'] %> + database: <%= ENV.fetch('DATABASE_NAME') %> + username: <%= ENV.fetch('DATABASE_USER') %> + password: <%= ENV.fetch('DATABASE_PASSWORD') %>