diff --git a/images/osmcha-web/Dockerfile b/images/osmcha-web/Dockerfile index b7d14e7b..70fe6d95 100644 --- a/images/osmcha-web/Dockerfile +++ b/images/osmcha-web/Dockerfile @@ -16,4 +16,4 @@ RUN sed -i "s|https://osmcha.org|$OSMCHA_URL|g" package.json RUN yarn build:${BUILD_ENV} FROM nginx:alpine -COPY --from=builder /app/build /assets \ No newline at end of file +COPY --from=builder /app/build /assets diff --git a/images/osmcha-web/start.sh b/images/osmcha-web/start.sh deleted file mode 100755 index 7408f7ff..00000000 --- a/images/osmcha-web/start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -ex -sed -i "s|https://osmcha.org|$OSMCHA_URL|g" package.json -yarn build:prod -cp -R build/* /staticfiles/ - -# mkdir -p /staticfiles/static/ -# chmod a+rw /staticfiles/static/ \ No newline at end of file diff --git a/images/osmcha-web/supervisord.conf b/images/osmcha-web/supervisord.conf deleted file mode 100644 index 8d520a8c..00000000 --- a/images/osmcha-web/supervisord.conf +++ /dev/null @@ -1,5 +0,0 @@ -[supervisord] -nodaemon=true - -[program:nginx] -command=/usr/sbin/nginx diff --git a/osm-seed/templates/osmcha-app/configMap.yaml b/osm-seed/templates/osmcha-app/configMap.yaml index 567485c4..0b127200 100644 --- a/osm-seed/templates/osmcha-app/configMap.yaml +++ b/osm-seed/templates/osmcha-app/configMap.yaml @@ -27,7 +27,7 @@ data: DJANGO_DEBUG: "False" DJANGO_ENV: "production" # OSM_SERVER_URL: {{ .Values.osmchaApi.env.OSM_SERVER_URL | quote }} - REDIS_URL: {{ .Release.Name }}-osmcha-redis + REDIS_URL: "redis://{{ .Release.Name }}-osmcha-redis:6379" --- apiVersion: v1 kind: ConfigMap @@ -42,6 +42,9 @@ data: } http { + access_log /dev/stdout; + error_log /dev/stderr; + include /etc/nginx/mime.types; default_type application/octet-stream; @@ -49,7 +52,7 @@ data: '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + # access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; diff --git a/osm-seed/templates/osmcha-app/deployment.yaml b/osm-seed/templates/osmcha-app/deployment.yaml index af1f12f2..5110e66e 100644 --- a/osm-seed/templates/osmcha-app/deployment.yaml +++ b/osm-seed/templates/osmcha-app/deployment.yaml @@ -44,13 +44,17 @@ spec: runAsUser: 0 containers: - name: osmcha-api + securityContext: + runAsUser: 0 image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}" command: - /bin/sh - -c - | set -x - gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file log-file.log --access-logfile access-logfile.log config.wsgi + pip install git+https://github.com/OpenHistoricalMap/social-core.git && + sed -i "s|https://api.openhistoricalmap.org/api/0.6/user/details|https://www.openhistoricalmap.org/api/0.6/user/details|g" /usr/local/lib/python3.10/site-packages/social_core/backends/openstreetmap.py + gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi ports: - containerPort: 5000 livenessProbe: @@ -74,8 +78,11 @@ spec: memory: {{ .Values.osmchaApi.resources.limits.memory }} cpu: {{ .Values.osmchaApi.resources.limits.cpu }} {{- end }} + - name: osmcha-nginx image: "{{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }}" + ports: + - containerPort: 80 volumeMounts: - name: osmcha-frontend-nginx-config mountPath: /etc/nginx diff --git a/osm-seed/templates/osmcha-app/service.yaml b/osm-seed/templates/osmcha-app/service.yaml index 268d859e..becc9980 100644 --- a/osm-seed/templates/osmcha-app/service.yaml +++ b/osm-seed/templates/osmcha-app/service.yaml @@ -10,9 +10,15 @@ metadata: release: {{ .Release.Name }} annotations: {{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }} - service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }} + # service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }} + # service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http + # service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https + meta.helm.sh/release-name: dev + meta.helm.sh/release-namespace: default service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http - service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https + service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:618380242247:certificate/9bc4e15c-2652-47ed-bfa8-3e078d708b87 + service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https {{- end }} {{- if eq .Values.serviceType "ClusterIP" }} kubernetes.io/ingress.class: nginx @@ -32,7 +38,7 @@ spec: name: http {{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }} - port: 443 - targetPort: http + targetPort: 80 protocol: TCP name: https {{- end }}