This commit is contained in:
parent
563f23f760
commit
cef1135cab
@ -1,12 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Collect static files
|
|
||||||
echo "Collect static files"
|
|
||||||
python manage.py collectstatic --noinput
|
|
||||||
|
|
||||||
# Apply database migrations
|
# Apply database migrations
|
||||||
echo "Apply database migrations"
|
echo "Apply database migrations"
|
||||||
python manage.py migrate
|
python manage.py migrate --noinput
|
||||||
|
|
||||||
# Start server
|
# Start server
|
||||||
echo "Starting server"
|
echo "Starting server"
|
||||||
|
57
geogame.yml
57
geogame.yml
@ -42,6 +42,37 @@ spec:
|
|||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apache-static
|
||||||
|
namespace: geogame
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apache-geogame
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apache-geogame
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: apache-geogame
|
||||||
|
image: apache:2
|
||||||
|
imagePullPolicy: "Always"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /usr/local/apache2/htdocs
|
||||||
|
name: geogame-static-volume
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
volumes:
|
||||||
|
- name: geogame-static-volume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: geogame-static-pv-claim
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: geogame
|
name: geogame
|
||||||
namespace: geogame
|
namespace: geogame
|
||||||
@ -60,21 +91,16 @@ spec:
|
|||||||
image: registry.kmlabz.com/tormakris/geogame
|
image: registry.kmlabz.com/tormakris/geogame
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /app/static
|
|
||||||
name: geogame-static-volume
|
|
||||||
- mountPath: /app/media
|
- mountPath: /app/media
|
||||||
name: geogame-media-volume
|
name: geogame-media-volume
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: xwiki-config
|
name: geogame-config
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: regcred
|
- name: regcred
|
||||||
volumes:
|
volumes:
|
||||||
- name: geogame-static-volume
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: geogame-static-pv-claim
|
|
||||||
- name: geogame-media-volume
|
- name: geogame-media-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: geogame-media-pv-claim
|
claimName: geogame-media-pv-claim
|
||||||
@ -94,6 +120,21 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app: geogame
|
app: geogame
|
||||||
---
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: geogame-static
|
||||||
|
namespace: geogame
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 80
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
app: apache-geogame
|
||||||
|
---
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
@ -115,3 +156,7 @@ spec:
|
|||||||
backend:
|
backend:
|
||||||
serviceName: geogame
|
serviceName: geogame
|
||||||
servicePort: http
|
servicePort: http
|
||||||
|
- path: /static
|
||||||
|
backend:
|
||||||
|
serviceName: geogame-static
|
||||||
|
servicePort: http
|
Loading…
Reference in New Issue
Block a user