Skip to content

Commit

Permalink
Upgrade 3.6.3 (#21)
Browse files Browse the repository at this point in the history
* update PI to 3.6.3
* update nginx to 1.21.5
  • Loading branch information
Sida Say authored Jan 13, 2022
1 parent 5c70c7e commit b5f89bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
45 changes: 24 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,35 @@ LABEL maintainer="Sida Say <sida.say@khalibre.com>"

ENV PI_SKIP_BOOTSTRAP=false \
DB_VENDOR=sqlite \
PI_VERSION=3.6.2
PI_VERSION=3.6.3

COPY ./configs/install-nginx-debian.sh /

RUN bash /install-nginx-debian.sh

EXPOSE 80

# Expose 443, in case of LTS / HTTPS
EXPOSE 443

# Install Supervisord
RUN set -xe; \
apt-get update && apt-get install -y ca-certificates; \
pip install supervisor uwsgi pymysql-sa PyMySQL;\
pip install -r https://raw.githubusercontent.com/privacyidea/privacyidea/v${PI_VERSION}/requirements.txt; \
pip install git+https://github.com/privacyidea/privacyidea.git@v${PI_VERSION}; \
apt-get remove --purge --auto-remove -y ca-certificates && rm -rf /var/lib/apt/lists/*

# COPY PI configuration
COPY ./configs/config.py /etc/privacyidea/pi.cfg

# Remove default configuration from Nginx
RUN rm /etc/nginx/conf.d/default.conf

# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY ./configs/uwsgi.ini /etc/uwsgi/

# Install Supervisord
RUN set -xe; \
apt-get update && apt-get install -y ca-certificates; \
pip install supervisor uwsgi pymysql-sa PyMySQL;\
pip install -r https://raw.githubusercontent.com/privacyidea/privacyidea/v${PI_VERSION}/requirements.txt; \
pip install git+https://github.com/privacyidea/privacyidea.git@v${PI_VERSION}; \
apt-get remove --purge --auto-remove -y ca-certificates && rm -rf /var/lib/apt/lists/*

# Custom Supervisord config
COPY ./configs/supervisord-debian.conf /etc/supervisor/supervisord.conf

# Add demo app
COPY ./configs/app /app

# Which uWSGI .ini file should be used, to make it customizable
ENV UWSGI_INI /app/uwsgi.ini

Expand All @@ -60,18 +58,23 @@ ENV NGINX_SERVER_TOKENS 'off'
# To modify this, change LISTEN_PORT environment variable.
# (in a Dockerfile or with an option for `docker run`)
ENV LISTEN_PORT 80
# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app
COPY ./configs/start.sh /start.sh
RUN chmod +x /start.sh

# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app
# Copy the entrypoint that will generate Nginx additional configs
COPY ./configs/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY ["configs/start.sh", "configs/entrypoint.sh", "/"]

# Make sure scripts can be executed and do some cleanup
RUN chmod +x /entrypoint.sh /start.sh \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& rm -rf /tmp/*

EXPOSE 80/tcp
EXPOSE 443/tcp

ENTRYPOINT ["/entrypoint.sh"]

# Add demo app
COPY ./configs/app /app
WORKDIR /app
VOLUME [ "/data/privacyidea" ]

Expand Down
4 changes: 2 additions & 2 deletions configs/install-nginx-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Ref: https://github.com/nginxinc/docker-nginx/blob/594ce7a8bc26c85af88495ac94d5cd0096b306f7/mainline/buster/Dockerfile

# Standard set up Nginx
export NGINX_VERSION=1.21.0
export NJS_VERSION=0.5.3
export NGINX_VERSION=1.21.5
export NJS_VERSION=0.7.1
export PKG_RELEASE=1~buster

set -x \
Expand Down

0 comments on commit b5f89bc

Please sign in to comment.