我的烧瓶申请认证工作正常,但是当我dockerise使用Alpine图像整个应用程序的认证被打破

问题描述 投票:0回答:1

我有一个基本的小瓶应用程序,运行时本地认证工作正常,但是当我dockerzise使用Alpine图像整个应用程序,该认证被打破。即使我在输入正确的凭据我的应用程序日志,但显示了一条错误消息“请登录访问此页面”。

我使用的Apache2我的反向代理和httpd的:高山为我的码头工人的形象。这是我的泊坞窗文件

FROM httpd:2.4.38-alpine

RUN apk --update --no-cache add python3 python3-dev apache2  wget ca-certificates make gcc musl-dev py-pip py-virtualenv

COPY ./app_trac/apache2-vhost.conf conf/extra/httpd-vhosts.conf

RUN sed -i -e 's/^#ServerName.*$/ServerName vacation.ps-office.local:80/' conf/httpd.conf

RUN sed -i -e "s|#Include conf/extra/httpd-vhosts.conf|Include conf/extra/httpd-vhosts.conf|g"  conf/httpd.conf

RUN cd /usr/local/apache2/modules/

RUN mkdir vacation

COPY ./app_trac/requirements.txt htdocs/app/requirements.txt

RUN pip3 install -r htdocs/app/requirements.txt

RUN pip3 install mod_wsgi

RUN mod_wsgi-express module-config

RUN chmod -R a+rwx htdocs/app

EXPOSE 80

CMD ["httpd", "-D", "FOREGROUND"]

这是我的应用程序的加载和保存用户的功能,我使用LDAP身份验证。

@login_manager.user_loader
def load_user(user_id):
    if user_id in users:
        return users[user_id]
    return None

@ldap_manager.save_user
def save_user(dn, username, data, memberships):
    user = User(dn = dn, username = username, data = data)
    users[dn] = user
    return user

什么我基本做错了吗?我得到的只有泊坞窗身份验证问题。 nginx的似乎很好地工作。

docker flask apache2 mod-wsgi flask-login
1个回答
0
投票

你必须允许容器访问LDAP服务器,运行容器中时网络访问这已经是有限的。

也许这可以帮助您LDAP authentication in Docker container

© www.soinside.com 2019 - 2024. All rights reserved.