File tree 10 files changed +52
-25
lines changed
10 files changed +52
-25
lines changed Original file line number Diff line number Diff line change
1
+ .git /
2
+ .github /
3
+ .holo /
4
+ computer-vision-form-project /
1
5
env /
2
- frontend /
6
+ frontend /
7
+ helm-chart /
8
+ metabase /
9
+ node_modules /
10
+ script /
11
+ unified-reporting-system /
12
+
13
+ ** /* .md
14
+ .dockerignore
15
+ .gitignore
16
+ Dockerfile
17
+ docker-compose.yml
Original file line number Diff line number Diff line change 1
1
FROM python:3.7-slim
2
2
3
3
ARG APP_USER=appuser
4
+ ENV DJANGO_SETTINGS_MODULE=core.settings.docker
4
5
5
6
COPY . /app
6
7
WORKDIR /app
@@ -27,6 +28,8 @@ RUN set -ex \
27
28
' \
28
29
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
29
30
&& pip install pipenv && pip install uwsgi && pipenv install --system \
30
- && apt-get purge -y --auto-remove $buildDeps
31
+ && apt-get purge -y --auto-remove $buildDeps
32
+
33
+ RUN python manage.py collectstatic --no-input
31
34
32
35
CMD ["uwsgi" , "uwsgi.ini" ]
Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ services:
13
13
- " 8000:8000"
14
14
depends_on :
15
15
- db
16
- environment :
17
- - DJANGO_SETTINGS_MODULE=core.settings.docker
18
16
client :
19
17
build : ./frontend
20
18
ports :
Original file line number Diff line number Diff line change
1
+ .cache /
2
+ dist /
1
3
node_modules /
2
4
test /
3
- .cache
4
- dist /
5
+
6
+ Dockerfile
7
+ nginx.conf
Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ RUN yarn && yarn build
5
5
6
6
FROM nginx:alpine
7
7
COPY --from=0 /app/dist /usr/share/nginx/html
8
- COPY ./nginx.conf /etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change 34
34
hostAliases :
35
35
- ip : " 127.0.0.1"
36
36
hostnames :
37
- - " app"
38
37
- " db"
39
38
containers :
40
39
{{- with .Values.backend }}
@@ -47,14 +46,14 @@ spec:
47
46
env :
48
47
- name : DJANGO_SETTINGS_MODULE
49
48
value : core.settings.docker
50
- # livenessProbe:
51
- # httpGet:
52
- # path: /
53
- # port: 8000
54
- # readinessProbe:
55
- # httpGet:
56
- # path: /
57
- # port: 8000
49
+ livenessProbe :
50
+ httpGet :
51
+ path : /admin /
52
+ port : 8000
53
+ readinessProbe :
54
+ httpGet :
55
+ path : /admin /
56
+ port : 8000
58
57
{{- end }}
59
58
{{- with .Values.frontend }}
60
59
- name : {{ $.Chart.Name }}-frontend
Original file line number Diff line number Diff line change 1
1
{{- if .Values.ingress.enabled -}}
2
2
{{- $fullName := include "prevention-point.fullname" . -}}
3
- {{- $svcPort := .Values.service.port -}}
4
3
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5
4
apiVersion : networking.k8s.io/v1beta1
6
5
{{- else -}}
36
35
- path : {{ . }}
37
36
backend :
38
37
serviceName : {{ $fullName }}
39
- servicePort : {{ $svcPort }}
38
+ servicePort : frontend-http
39
+ - path : {{ . | trimSuffix "/" }}/api/
40
+ backend :
41
+ serviceName : {{ $fullName }}
42
+ servicePort : backend-http
43
+ - path : {{ . | trimSuffix "/" }}/admin/
44
+ backend :
45
+ serviceName : {{ $fullName }}
46
+ servicePort : backend-http
47
+ - path : {{ . | trimSuffix "/" }}/static/admin/
48
+ backend :
49
+ serviceName : {{ $fullName }}
50
+ servicePort : backend-http
40
51
{{- end }}
41
52
{{- end }}
42
53
{{- end }}
Original file line number Diff line number Diff line change @@ -8,9 +8,13 @@ metadata:
8
8
spec :
9
9
type : {{ .Values.service.type }}
10
10
ports :
11
- - port : {{ .Values.service.port }}
11
+ - port : 80
12
12
targetPort : http
13
13
protocol : TCP
14
- name : http
14
+ name : frontend-http
15
+ - port : 8000
16
+ targetPort : 8000
17
+ protocol : TCP
18
+ name : backend-http
15
19
selector :
16
20
{{- include "prevention-point.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ podSecurityContext: {}
41
41
42
42
service :
43
43
type : ClusterIP
44
- port : 80
45
44
46
45
ingress :
47
46
enabled : false
Original file line number Diff line number Diff line change 13
13
echo " ==> Starting containers with docker-compose…"
14
14
docker-compose up -d --build
15
15
16
- echo
17
- echo " ==> Initialize static assets"
18
- docker-compose exec app python manage.py collectstatic
19
-
20
16
echo
21
17
echo " ==> App is now ready to go!"
22
18
echo " *Open http://localhost:8080"
You can’t perform that action at this time.
0 commit comments