-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpod.yaml
126 lines (121 loc) · 2.62 KB
/
pod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apiVersion: v1
stringData:
username: admin
password: senhaSuperDificil
kind: Secret
metadata:
creationTimestamp: null
name: adminCredential
type: Opaque
---
apiVersion: v1
stringData:
username: api
password: senhaDificil
kind: Secret
metadata:
creationTimestamp: null
name: apiCredential
type: Opaque
---
apiVersion: v1
kind: Pod
metadata:
name: map-feature-latest
labels:
app: map-feature-latest
spec:
containers:
- name: banco
image: docker.io/postgis/postgis
ports:
- containerPort: 5432
volumeMounts:
- name: initdatabase
mountPath: /docker-entrypoint-initdb.d
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: adminCredential
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: adminCredential
key: password
- name: POSTGRES_DB
value: mapfeature
- name: API_USERNAME
valueFrom:
secretKeyRef:
name: apiCredential
key: username
- name: API_PASSWORD
valueFrom:
secretKeyRef:
name: apiCredential
key: password
- name: nginx
image: docker.io/library/nginx:latest
ports:
- containerPort: 80
hostPort: 8000
volumeMounts:
- name: build
mountPath: /usr/share/nginx/html
- name: conf
mountPath: /etc/nginx/conf.d/
- name: api1
image: arthurrabel/fastapi.with.geoalchemy:1.2
ports:
- containerPort: 81
env:
- name: API_USERNAME
valueFrom:
secretKeyRef:
name: apiCredential
key: username
- name: API_PASSWORD
valueFrom:
secretKeyRef:
name: apiCredential
key: password
command: ["/bin/sh", "-c"]
args:
- |
/wait-for-it.sh banco:5432 --timeout=30 --strict;
uvicorn main:app --host 0.0.0.0 --port 81
- name: api2
image: arthurrabel/fastapi.with.geoalchemy:1.2
ports:
- containerPort: 82
env:
- name: API_USERNAME
valueFrom:
secretKeyRef:
name: apiCredential
key: username
- name: API_PASSWORD
valueFrom:
secretKeyRef:
name: apiCredential
key: password
command: ["/bin/sh", "-c"]
args:
- |
/wait-for-it.sh banco:5432 --timeout=30 --strict;
uvicorn main:app --host 0.0.0.0 --port 82
volumes:
- name: build
hostPath:
path: ./frontEnd/build
type: Directory
- name: conf
hostPath:
path: ./frontEnd/nginx
type: Directory
- name: initdatabase
hostPath:
path: ./database
type: Directory