Skip to content

Commit

Permalink
Add the ability to start the rails server & create a db
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilrieger committed Oct 23, 2023
1 parent 7c7ca95 commit 683dd94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
RAILS_HOST_NAME=local3000.notch8.cloud
RAILS_HOST_NAME=scibot.test
BASE_URL=https://${RAILS_HOST_NAME}
DATABASE_URL="postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@db/${DATABASE_NAME}?pool=30"
DATABASE_URL="postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}/${DATABASE_NAME}?pool=30"
DATABASE_NAME=scibot
DATABASE_PASSWORD=testing123
DATABASE_USER=postgres
DATABASE_HOST=db
RAILS_ENV=development
RAILS_SECRET_TOKEN=
SLACK_CLIENT_ID=
Expand Down
17 changes: 17 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ spec:
serviceAccountName: {{ include "chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: db-create
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["sh", "-c", "rails db:create"]
envFrom:
- configMapRef:
name: {{ include "chart.fullname" . }}-cm
- secretRef:
name: {{ include "chart.fullname" . }}-secret
- name: db-migrate
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["sh", "-c", "rails db:migrate"]
envFrom:
- configMapRef:
name: {{ include "chart.fullname" . }}-cm
- secretRef:
name: {{ include "chart.fullname" . }}-secret
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down

0 comments on commit 683dd94

Please sign in to comment.