parent
862398d2cf
commit
a8b9a6cad9
@ -0,0 +1,73 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: django-static
|
||||
namespace: spatial
|
||||
labels:
|
||||
app.kubernetes.io/name: django-static
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: django-static
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: django-static
|
||||
spec:
|
||||
containers:
|
||||
- name: django
|
||||
image: DEPLOY_IMAGE_TAG
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /nginx-health
|
||||
port: 8888
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /nginx-health
|
||||
port: 8888
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 3
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: django-static
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: django-static
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: django-static
|
||||
namespace: spatial
|
||||
spec:
|
||||
ingressClassName: nginx-internal
|
||||
rules:
|
||||
- host: ADDRESS_INGRESS_HOST
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: django-static
|
||||
port:
|
||||
number: 80
|
||||
path: /django_static/
|
||||
pathType: ImplementationSpecific
|
||||
@ -0,0 +1,8 @@
|
||||
ARG DJANGO_DOCKER_IMAGE_TAG
|
||||
ARG YC_CONTAINER_REGISTRY
|
||||
FROM ${DJANGO_DOCKER_IMAGE_TAG} as builder
|
||||
RUN python manage.py collectstatic --noinput
|
||||
|
||||
FROM ${YC_CONTAINER_REGISTRY}/public/nginx:1.23-alpine
|
||||
COPY ./deploy/nginx_conf/default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=builder /code/django_static /usr/share/nginx/html/django_static
|
||||
@ -0,0 +1,18 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8888;
|
||||
server_name _;
|
||||
location /nginx-health {
|
||||
return 200 "healthy\n";
|
||||
access_log off;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue