File tree Expand file tree Collapse file tree 5 files changed +105
-0
lines changed Expand file tree Collapse file tree 5 files changed +105
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ FROM node:20.9.0-slim
7
7
# Update basic packages
8
8
RUN apt-get update && apt-get install -y nano supervisor openssh-server git bash wget curl locales libc6 libstdc++6 python-is-python3 ca-certificates tar
9
9
10
+ # Install PostgreSQL client
11
+ RUN apt-get install -y postgresql-client
12
+
10
13
# SSH keys and some login related stuff (some work only for prod)
11
14
RUN mkdir -p /run/sshd /root/.ssh \
12
15
&& chmod 0700 /root/.ssh \
Original file line number Diff line number Diff line change 1
1
[ Astro] ( https://astro.build/ ) is an all-in-one web framework for building fast, content-focused websites.
2
2
SSR support with the [ Node.js] ( https://docs.astro.build/en/guides/integrations-guide/node/ ) adapter is preconfigured.
3
+
4
+ ### PostgreSQL
5
+
6
+ You can optionally add a PostgreSQL DB to your project.
7
+
8
+ Connect via CLI:
9
+
10
+ ``` bash
11
+ su postgres -c ' psql'
12
+ ```
Original file line number Diff line number Diff line change @@ -15,6 +15,35 @@ contexts:
15
15
- name : app
16
16
identifier : app
17
17
18
+ parameterGroups :
19
+ - name : PostgreSQL Database
20
+ identifier : postgres
21
+ toggleable : true
22
+ description : Database connection info
23
+ defaultValue : FALSE
24
+ parameters :
25
+ - name : Host
26
+ identifier : POSTGRES_HOST
27
+ defaultValue : postgres
28
+ type : string
29
+ - name : Port
30
+ identifier : POSTGRES_PORT
31
+ defaultValue : 5432
32
+ type : integer
33
+ - name : User
34
+ identifier : POSTGRES_USER
35
+ defaultValue : postgres
36
+ type : string
37
+ contexts : label=postgres,label=app
38
+ - name : Password
39
+ identifier : POSTGRES_PASSWORD
40
+ defaultValue : postgres
41
+ type : secret
42
+ - name : Schema
43
+ identifier : POSTGRES_DB
44
+ defaultValue : todo
45
+ type : string
46
+
18
47
repositories :
19
48
- name : app
20
49
identifier : app
@@ -59,6 +88,12 @@ storage:
59
88
stages :
60
89
- development
61
90
sizeMiB : 6144
91
+ - identifier : postgres
92
+ stages :
93
+ - production
94
+ - staging
95
+ - development
96
+ sizeMiB : 4096
62
97
63
98
status :
64
99
url : http://app:3000/status
Original file line number Diff line number Diff line change
1
+ {{- if eq .Values.parameterGroupsEnabled.postgres true }}
2
+ apiVersion : v1
3
+ kind : Service
4
+ metadata :
5
+ name : postgres
6
+ spec :
7
+ type : NodePort
8
+ ports :
9
+ - name : postgres
10
+ port : 5432
11
+ selector :
12
+ app : postgres
13
+ {{ end }}
Original file line number Diff line number Diff line change
1
+ {{- if eq .Values.parameterGroupsEnabled.postgres true }}
2
+ apiVersion : apps/v1
3
+ kind : StatefulSet
4
+ metadata :
5
+ name : postgres
6
+ spec :
7
+ selector :
8
+ matchLabels :
9
+ app : postgres
10
+ serviceName : postgres
11
+ replicas : {{ ternary 1 0 $.Values.enabled }}
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : postgres
16
+ spec :
17
+ containers :
18
+ - name : postgres
19
+ image : postgres:14.1
20
+ imagePullPolicy : Always
21
+ ports :
22
+ - containerPort : 5432
23
+ name : postgres
24
+ env :
25
+ - name : PGDATA
26
+ value : /postgres/data
27
+ {{- range $.Values.env }}
28
+ {{- if contains "postgres" .contexts }}
29
+ - name : {{ .identifier }}
30
+ value : {{ .value | quote }}
31
+ {{- end }}
32
+ {{- end }}
33
+ {{- range $.Values.parameterGroups }}
34
+ - name : {{ .identifier }}
35
+ value : {{ .value | quote }}
36
+ {{- end }}
37
+ volumeMounts :
38
+ - name : postgres-mount
39
+ mountPath : /postgres
40
+ volumes :
41
+ - name : postgres-mount
42
+ hostPath :
43
+ path : {{ $.Values.storage.postgres.hostPath }}
44
+ {{ end }}
You can’t perform that action at this time.
0 commit comments