Use python3 by default

This commit is contained in:
Jérôme Schneider 2021-09-07 11:46:51 +02:00
parent ef8d313042
commit 6af6d71d5a
5 changed files with 8 additions and 9 deletions

View File

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=2 ARG PYTHON_VERSION=3
FROM python:${PYTHON_VERSION}-alpine FROM python:${PYTHON_VERSION}-alpine
COPY nginx-ldap-auth-daemon.py /usr/src/app/ COPY nginx-ldap-auth-daemon.py /usr/src/app/
@ -9,9 +9,9 @@ WORKDIR /usr/src/app/
RUN \ RUN \
apk --no-cache add openldap-dev && \ apk --no-cache add openldap-dev && \
apk --no-cache add --virtual build-dependencies build-base && \ apk --no-cache add --virtual build-dependencies build-base && \
pip install python-ldap && \ pip3 install python-ldap && \
apk del build-dependencies apk del build-dependencies
EXPOSE 8888 EXPOSE 8888
CMD ["python", "/usr/src/app/nginx-ldap-auth-daemon.py", "--host", "0.0.0.0", "--port", "8888"] CMD ["python3", "/usr/src/app/nginx-ldap-auth-daemon.py", "--host", "0.0.0.0", "--port", "8888"]

4
debian/control vendored
View File

@ -3,11 +3,11 @@ Maintainer: Ippolitov Igor <iippolitov@nginx.com>
Section: misc Section: misc
Priority: optional Priority: optional
Standards-Version: 3.9.7 Standards-Version: 3.9.7
Build-Depends: debhelper (>= 9), dh-systemd, python, dh-python, dh-exec Build-Depends: debhelper (>= 9), dh-systemd, python3, dh-python, dh-exec
Package: nginx-ldap-auth Package: nginx-ldap-auth
Architecture: all Architecture: all
Depends: systemd, python(>=2.6), python-ldap, python-argparse Depends: systemd, python3(>=3.7), python3-ldap
Description: a reference implementation of an authentication helper for Nginx Description: a reference implementation of an authentication helper for Nginx
This is a reference implementation of an authentication helper for Nginx. This is a reference implementation of an authentication helper for Nginx.
It listens for incoming requests and uses parameters from headers It listens for incoming requests and uses parameters from headers

2
debian/rules vendored
View File

@ -1,3 +1,3 @@
#!/usr/bin/make -f #!/usr/bin/make -f
%: %:
dh $@ --with python2 --with systemd dh $@ --with python3 --with systemd

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
''''[ -z $LOG ] && export LOG=/dev/stdout # ''' ''''[ -z $LOG ] && export LOG=/dev/stdout # '''
''''which python >/dev/null && exec python -u "$0" "$@" >> $LOG 2>&1 # ''' ''''which python3 >/dev/null && exec python3 -u "$0" "$@" >> $LOG 2>&1 # '''
# Copyright (C) 2014-2015 Nginx, Inc. # Copyright (C) 2014-2015 Nginx, Inc.

View File

@ -12,8 +12,7 @@ Source0: nginx-ldap-auth-release-%{version}.tar.gz
BuildRequires: systemd BuildRequires: systemd
Requires: systemd Requires: systemd
Requires: python-ldap Requires: python3-ldap
Requires: python-argparse
Requires: logrotate Requires: logrotate
%description %description