Browse Source

Quito nginx y pongo staticfiles_dirs

main
Celestino Rey 2 months ago
parent
commit
dcc20bffbc
3 changed files with 3 additions and 68 deletions
  1. +0
    -46
      K8S/nginx-deployment.yaml
  2. +0
    -20
      K8S/nginx-service.yaml
  3. +3
    -2
      src/reymota/settings.py

+ 0
- 46
K8S/nginx-deployment.yaml View File

@ -1,46 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.34.0 (cbf2835db)
labels:
io.kompose.service: nginx
name: nginx
namespace: reymota
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: nginx
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.34.0 (cbf2835db)
labels:
io.kompose.service: nginx
spec:
containers:
- image: $REGISTRY/nginx-reymota-$ARQUITECTURA:$IMG_NGINX_VERSION
name: nginx
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /app/reymota/staticfiles
name: static-volume
- mountPath: /app/reymota/mediafiles
name: reymota-media
imagePullSecrets:
- name: myregistrykey
restartPolicy: Always
volumes:
- name: static-volume
persistentVolumeClaim:
claimName: static-volume
- name: reymota-media
persistentVolumeClaim:
claimName: reymota-media

+ 0
- 20
K8S/nginx-service.yaml View File

@ -1,20 +0,0 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.34.0 (cbf2835db)
labels:
io.kompose.service: nginx
name: nginx
namespace: reymota
spec:
type: NodePort
ports:
- name: "1337"
port: 1337
nodePort: 30341
targetPort: 80
selector:
io.kompose.service: nginx

+ 3
- 2
src/reymota/settings.py View File

@ -37,6 +37,8 @@ OPENSHIFT = os.environ["OPENSHIFT"] == 'True'
ALLOWED_HOSTS = [".ocp-cluster.reymota.lab", "reymota.es", ".reymota.lab"]
CSRF_TRUSTED_ORIGINS = ["https://*.ocp-cluster.reymota.lab", "https://reymota.es", "http://reymota.rancher.reymota.lab"]
# Application definition
INSTALLED_APPS = [
@ -142,6 +144,7 @@ THOUSAND_SEPARATOR = '.'
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_DIRS = [BASE_DIR / "static",]
# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
@ -157,8 +160,6 @@ AUTH_USER_MODEL = "reymotausers.ReyMotaUser"
MEDIA_ROOT = BASE_DIR / "mediafiles"
MEDIA_URL = '/media/'
CSRF_TRUSTED_ORIGINS = ["https://*.ocp-cluster.reymota.lab", "https://reymota.es", "http://reymota.rancher.reymota.lab"]
LOGGING = {
'version': 1,
'disable_existing_loggers': False,


Loading…
Cancel
Save