@@ -23,50 +23,23 @@ spec:
23
23
run : {{ .Release.Name }}-osmcha-app
24
24
spec :
25
25
initContainers :
26
- - name : web-builder
27
- image : " {{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }}"
28
- envFrom :
29
- - configMapRef :
30
- name : {{ .Release.Name }}-osmcha-common-env
31
- volumeMounts :
32
- - name : nginx-assets
33
- mountPath : /assets
34
- - name : migrations
26
+ - name : osmcha-init
35
27
image : " {{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
36
28
command :
37
- - /bin/sh
38
- - -c
39
- - |
40
- set -x
41
- flag=true
42
- while "$flag" = true; do
43
- pg_isready -h $POSTGRES_HOST -p 5432 >/dev/null 2>&2 || continue
44
- flag=false
45
- python manage.py migrate
46
- python manage.py collectstatic --noinput
47
- mkdir -p /staticfiles/static
48
- cp -r /app/staticfiles/* /staticfiles/static/
49
- done
29
+ - /bin/sh
30
+ - -c
31
+ - python manage.py migrate
32
+ - python manage.py collectstatic --noinput
50
33
envFrom :
51
34
- configMapRef :
52
35
name : {{ .Release.Name }}-osmcha-common-env
53
36
volumeMounts :
54
37
- name : staticfiles
55
- mountPath : /staticfiles
56
- # securityContext:
57
- # runAsUser: 0
38
+ mountPath : /app/staticfiles
58
39
containers :
59
- - name : api
60
- # securityContext:
61
- # runAsUser: 0
40
+ - name : osmcha-api
62
41
image : " {{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
63
- command :
64
- - /bin/sh
65
- - -c
66
- - |
67
- set -x
68
- echo "start app...."
69
- gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi
42
+ args : ["gunicorn", "config.wsgi", "-b", "0.0.0.0:5000", "--access-logfile", "-", "--timeout", "120", "--workers", "4", "--threads", "16"]
70
43
ports :
71
44
- containerPort : 5000
72
45
livenessProbe :
@@ -75,12 +48,13 @@ spec:
75
48
port : 5000
76
49
initialDelaySeconds : 60
77
50
timeoutSeconds : 30
78
- envFrom :
79
- - configMapRef :
80
- name : {{ .Release.Name }}-osmcha-common-env
51
+
81
52
volumeMounts :
82
53
- name : staticfiles
83
54
mountPath : /staticfiles
55
+ envFrom :
56
+ - configMapRef :
57
+ name : {{ .Release.Name }}-osmcha-common-env
84
58
{{- if .Values.osmchaApi.resources.enabled }}
85
59
resources :
86
60
requests :
@@ -91,31 +65,24 @@ spec:
91
65
cpu : {{ .Values.osmchaApi.resources.limits.cpu }}
92
66
{{- end }}
93
67
94
- - name : nginx
95
- image : " nginx:latest "
68
+ - name : frontend- nginx
69
+ image : " {{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }} "
96
70
ports :
97
71
- containerPort : 80
72
+ env :
73
+ - name : BACKEND_URL
74
+ value : http://localhost:5000
98
75
volumeMounts :
99
- - name : osmcha-frontend-nginx-config
100
- mountPath : /etc/nginx
101
- readOnly : true
102
76
- name : staticfiles
103
- mountPath : /staticfiles
104
- - name : nginx-assets
105
- mountPath : /assets
77
+ mountPath : /srv/www/static/django
78
+ readOnly : true
106
79
- name : redis
107
80
image : " redis:latest"
108
81
ports :
109
82
- containerPort : 6379
110
83
volumes :
111
84
- name : staticfiles
112
85
emptyDir : {}
113
- - name : nginx-assets
114
- emptyDir : {}
115
- - name : osmcha-frontend-nginx-config
116
- configMap :
117
- name : {{ .Release.Name }}-osmcha-nginx-config
118
- defaultMode : 0777
119
86
{{- if .Values.osmchaApi.nodeSelector.enabled }}
120
87
nodeSelector :
121
88
{{ .Values.osmchaApi.nodeSelector.label_key }} : {{ .Values.osmchaApi.nodeSelector.label_value }}
0 commit comments