fix static
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-12-30 02:06:27 +01:00
parent 563f23f760
commit cef1135cab
2 changed files with 52 additions and 11 deletions

View File

@ -1,12 +1,8 @@
#!/usr/bin/env bash
# Collect static files
echo "Collect static files"
python manage.py collectstatic --noinput
# Apply database migrations
echo "Apply database migrations"
python manage.py migrate
python manage.py migrate --noinput
# Start server
echo "Starting server"

View File

@ -42,6 +42,37 @@ spec:
---
apiVersion: apps/v1
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:
name: geogame
namespace: geogame
@ -60,21 +91,16 @@ spec:
image: registry.kmlabz.com/tormakris/geogame
imagePullPolicy: "Always"
volumeMounts:
- mountPath: /app/static
name: geogame-static-volume
- mountPath: /app/media
name: geogame-media-volume
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: xwiki-config
name: geogame-config
imagePullSecrets:
- name: regcred
volumes:
- name: geogame-static-volume
persistentVolumeClaim:
claimName: geogame-static-pv-claim
- name: geogame-media-volume
persistentVolumeClaim:
claimName: geogame-media-pv-claim
@ -94,6 +120,21 @@ spec:
selector:
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
kind: Ingress
metadata:
@ -115,3 +156,7 @@ spec:
backend:
serviceName: geogame
servicePort: http
- path: /static
backend:
serviceName: geogame-static
servicePort: http