This commit is contained in:
Aitzol 2023-04-20 11:55:17 +02:00
parent f7a4b6ab72
commit 3abac37ba4
3 changed files with 17 additions and 12 deletions

View File

@ -1,14 +1,11 @@
FROM python:3-alpine FROM python:3-alpine
ARG UID_
ENV UID_=1000
RUN apk add --no-cache --upgrade bash RUN apk add --no-cache --upgrade bash
RUN mkdir -p /www
RUN chown -R 1000:1000 /www ADD --chown=$UID_:$UID_ . /www
WORKDIR /www WORKDIR /www
COPY . .
#COPY --chown=1000:1000 . .
#COPY --chown=daemon:daemon settings.ini.example settings.ini
RUN cp settings.ini.example settings.ini
RUN chmod +x start.sh RUN chmod +x start.sh
RUN set -e; \ RUN set -e; \
apk add --no-cache --virtual .build-deps \ apk add --no-cache --virtual .build-deps \
@ -19,6 +16,4 @@ RUN set -e; \
pip install -r requirements.txt; \ pip install -r requirements.txt; \
apk del .build-deps; apk del .build-deps;
#EXPOSE 9090
USER 1000
ENTRYPOINT ["./start.sh"] ENTRYPOINT ["./start.sh"]

View File

@ -48,6 +48,10 @@ Biltegi honetako edukiak klonatu eta menpekotasunak instalatu:
docker build -t aitzol/ldap-webui:latest . docker build -t aitzol/ldap-webui:latest .
edo
docker build -t aitzol/ldap-webui:latest . --build-arg UID_=$UID
#### Edukiontzia sortu #### Edukiontzia sortu
docker-compose up -d docker-compose up -d

View File

@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
if [ ! -f /tmp/foo.txt ]; then if [ ! -f settings.ini ]; then
cp settings.ini.example settings.ini cp settings.ini.example settings.ini
fi fi
uwsgi --http :9090 --enable-threads --uid 1000 --wsgi-file app.py
if [[ $# -gt 0 ]]; then
UID_=$1
echo $UID_
fi
uwsgi --http :9090 --enable-threads --uid $UID_ --wsgi-file app.py