File tree 6 files changed +125
-12
lines changed
6 files changed +125
-12
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
services :
3
3
app :
4
- image : node:18-slim
5
4
build :
6
5
context : ./src/app
7
6
dockerfile : Dockerfile
7
+ target : environment
8
8
working_dir : /usr/local/src
9
9
environment :
10
10
- PORT=4321
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : {{ include "third-places.fullname" . }}-frontend
5
+ labels :
6
+ {{- include "third-places.labels" . | nindent 4 }}
7
+ app.kubernetes.io/component : frontend
8
+ spec :
9
+ replicas : {{ .Values.replicaCount }}
10
+ selector :
11
+ matchLabels :
12
+ {{- include "third-places.selectorLabels" . | nindent 6 }}
13
+ app.kubernetes.io/component : frontend
14
+ template :
15
+ metadata :
16
+ {{- with .Values.podAnnotations }}
17
+ annotations :
18
+ {{- toYaml . | nindent 8 }}
19
+ {{- end }}
20
+ labels :
21
+ {{- include "third-places.selectorLabels" . | nindent 8 }}
22
+ app.kubernetes.io/component : frontend
23
+ spec :
24
+ {{- with .Values.imagePullSecrets }}
25
+ imagePullSecrets :
26
+ {{- toYaml . | nindent 8 }}
27
+ {{- end }}
28
+ containers :
29
+ - name : {{ .Chart.Name }}-frontend
30
+ image : " {{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
31
+ imagePullPolicy : {{ .Values.frontend.image.pullPolicy }}
32
+ ports :
33
+ - name : http
34
+ containerPort : 80
35
+ protocol : TCP
36
+ livenessProbe :
37
+ httpGet :
38
+ path : /
39
+ port : http
40
+ readinessProbe :
41
+ httpGet :
42
+ path : /
43
+ port : http
44
+ resources :
45
+ {{- toYaml .Values.resources | nindent 12 }}
46
+ {{- with .Values.nodeSelector }}
47
+ nodeSelector :
48
+ {{- toYaml . | nindent 8 }}
49
+ {{- end }}
50
+ {{- with .Values.affinity }}
51
+ affinity :
52
+ {{- toYaml . | nindent 8 }}
53
+ {{- end }}
54
+ {{- with .Values.tolerations }}
55
+ tolerations :
56
+ {{- toYaml . | nindent 8 }}
57
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Service
3
+ metadata :
4
+ name : {{ include "third-places.fullname" . }}-frontend
5
+ labels :
6
+ {{- include "third-places.labels" . | nindent 4 }}
7
+ app.kubernetes.io/component : frontend
8
+ spec :
9
+ type : ClusterIP
10
+ ports :
11
+ - port : 80
12
+ targetPort : http
13
+ protocol : TCP
14
+ name : http
15
+ selector :
16
+ {{- include "third-places.selectorLabels" . | nindent 4 }}
17
+ app.kubernetes.io/component : frontend
Original file line number Diff line number Diff line change 1
1
{{- if .Values.ingress.enabled -}}
2
2
{{- $fullName := include "third-places.fullname" . -}}
3
- {{- $svcPort := .Values.service.port -}}
4
3
apiVersion : networking.k8s.io/v1
5
4
kind : Ingress
6
5
metadata :
@@ -33,12 +32,26 @@ spec:
33
32
paths :
34
33
{{- range .paths }}
35
34
- path : {{ . }}
35
+ pathType : Prefix
36
+ backend :
37
+ service :
38
+ name : {{ $fullName }}-frontend
39
+ port :
40
+ name : http
41
+ - path : {{ . | trimSuffix "/" }}/api/
42
+ pathType : Prefix
43
+ backend :
44
+ service :
45
+ name : {{ $fullName }}
46
+ port :
47
+ name : http
48
+ - path : {{ . | trimSuffix "/" }}/admin/
36
49
pathType : Prefix
37
50
backend :
38
51
service :
39
52
name : {{ $fullName }}
40
53
port :
41
- number : {{ $svcPort }}
54
+ name : http
42
55
{{- end }}
43
56
{{- end }}
44
57
{{- end }}
Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ tolerations: []
54
54
55
55
affinity : {}
56
56
57
+ frontend :
58
+ image :
59
+ repository : ghcr.io/codeforphilly/third-places/frontend
60
+ pullPolicy : IfNotPresent
61
+ # Overrides the image tag whose default is the chart appVersion.
62
+ tag : 0.1.2
63
+
57
64
postgresql :
58
65
image :
59
66
repository : postgis/postgis
Original file line number Diff line number Diff line change 1
- FROM node:18-slim
2
- ARG HOME=usr/local/src/
3
- WORKDIR $HOME
1
+ # # Target: environment
2
+ #
3
+ # This initially-empty target provides an environment for docker-compose
4
+ # to start from the same base as the production builder environment. Common
5
+ # dependencies could be added here
6
+ #
7
+ FROM node:18-slim as environment
4
8
5
- COPY entrypoint.sh /entrypoint.sh
6
- RUN chmod +x /entrypoint.sh
7
9
8
- ADD . .
9
- ENTRYPOINT [ "/entrypoint.sh" ]
10
- CMD ["npm" , "run" , "dev" , "--host" ]
11
- EXPOSE 4321
10
+ # # Target: builder
11
+ #
12
+ # This target builds /src/dist with layers optimized for caching dependencies
13
+ #
14
+ FROM environment as builder
15
+ WORKDIR /src
16
+
17
+ COPY package*.json ./
18
+ RUN npm ci
19
+
20
+ COPY * ./
21
+ RUN npm run build
22
+
23
+
24
+ # # Target: runtime
25
+ #
26
+ # This target provides an nginx web server wrapped around the static
27
+ # website build from the builder target
28
+ #
29
+ FROM nginx:alpine as runtime
30
+ COPY --from=builder /src/dist /usr/share/nginx/html
You can’t perform that action at this time.
0 commit comments