Skip to content

Commit

Permalink
Merge pull request #33 from dignajar/fix-uid-and-gid-in-dockerfile
Browse files Browse the repository at this point in the history
Fixed UID and GID; Update Helm chart and K8S manifests
  • Loading branch information
dignajar authored Jun 25, 2021
2 parents a5f32be + c25db4b commit e7e741c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ RUN apk --no-cache add build-base openldap-dev libffi-dev
COPY files/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt --no-cache-dir

# Run as non-root
ENV USER aldap
ENV UID 10001
ENV GROUP aldap
ENV GID 10001
ENV HOME /home/$USER
RUN adduser -D $USER
USER $USER
WORKDIR $HOME
RUN addgroup -g $GID -S $GROUP && adduser -u $UID -S $USER -G $GROUP

# Python code
COPY files/* $HOME/
RUN chown -R $USER:$GROUP $HOME

EXPOSE 9000
USER $UID:$GID
WORKDIR $HOME
CMD ["python3", "-u", "main.py"]
4 changes: 2 additions & 2 deletions chart/another-ldap-auth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: another-ldap-auth
description: A Helm chart using another-ldap-auth to enable AD or LDAP based basic-authentication for ingress resources
type: application
version: 0.2.0
appVersion: 2.0.2
version: 0.3.0
appVersion: 2.2.1
keywords:
- ingress
- nginx
Expand Down
2 changes: 1 addition & 1 deletion chart/another-ldap-auth/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# another-ldap-auth

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.2](https://img.shields.io/badge/AppVersion-2.0.2-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.1](https://img.shields.io/badge/AppVersion-2.2.1-informational?style=flat-square)

A Helm chart using another-ldap-auth to enable AD or LDAP based basic-authentication for ingress resources

Expand Down
2 changes: 1 addition & 1 deletion chart/another-ldap-auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ replicaCount: 1
image:
repository: dignajar/another-ldap-auth
pullPolicy: IfNotPresent
tag: "2.0.2"
tag: "2.2.1"

imagePullSecrets: []
nameOverride: ""
Expand Down
16 changes: 15 additions & 1 deletion kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,18 @@ spec:
valueFrom:
secretKeyRef:
name: another-ldap-auth
key: LDAP_MANAGER_PASSWORD
key: LDAP_MANAGER_PASSWORD
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
runAsUser: 10001
capabilities:
drop:
- ALL
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 100m
memory: 128Mi

0 comments on commit e7e741c

Please sign in to comment.