diff --git a/Dockerfile b/Dockerfile index 26c8598..3d383ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,10 @@ COPY . /app RUN yarn build # production environment -FROM nginx:stable-alpine +FROM nginxinc/nginx-unprivileged:stable-alpine COPY --from=build /app/build /usr/share/nginx/html RUN rm /etc/nginx/conf.d/default.conf COPY nginx/nginx.conf /etc/nginx/conf.d -EXPOSE 80 +EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 1951b7c..f4d9068 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -26,9 +26,12 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repo }}/{{ .Chart.Name }}:{{ .Chart.Version }}" imagePullPolicy: IfNotPresent + securityContext: + runAsNonRoot: true + runAsUser: 101 ports: - name: http - containerPort: 80 + containerPort: 8080 protocol: TCP {{- if .Values.probes.enabled }} livenessProbe: diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index 210ab73..3f56c26 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: ClusterIP ports: - port: {{ .Values.service.port | default 80 }} - targetPort: 80 + targetPort: 8080 protocol: TCP name: http selector: diff --git a/nginx/nginx.conf b/nginx/nginx.conf index d4d02d2..a6975fe 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 8080; location / { root /usr/share/nginx/html; index index.html index.htm;