mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-18 14:55:09 +01:00
V4.x Docker Refactoring and Docs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
FROM python:3.11-slim
|
||||
ARG AUTH_VERSION=v4.0.0a1
|
||||
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
ENV AUTH_USER=allianceauth
|
||||
ENV AUTH_GROUP=allianceauth
|
||||
ENV AUTH_USERGROUP=${AUTH_USER}:${AUTH_GROUP}
|
||||
@@ -12,37 +11,31 @@ ENV AUTH_HOME=/home/allianceauth
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
RUN groupadd -g 61000 ${AUTH_GROUP}
|
||||
RUN useradd -g 61000 -l -M -s /bin/false -u 61000 ${AUTH_USER}
|
||||
RUN mkdir -p ${VIRTUAL_ENV} \
|
||||
&& chown ${AUTH_USERGROUP} ${VIRTUAL_ENV} \
|
||||
&& mkdir -p ${STATIC_BASE} \
|
||||
RUN mkdir -p ${STATIC_BASE} \
|
||||
&& chown ${AUTH_USERGROUP} ${STATIC_BASE} \
|
||||
&& mkdir -p ${AUTH_HOME} \
|
||||
&& chown ${AUTH_USERGROUP} ${AUTH_HOME}
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
||||
libmariadb-dev gcc supervisor git htop
|
||||
|
||||
# Switch to non-root user
|
||||
USER ${AUTH_USER}
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
WORKDIR ${AUTH_HOME}
|
||||
libmariadb-dev gcc git
|
||||
|
||||
# Install python dependencies
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install wheel gunicorn
|
||||
RUN pip install ${AUTH_PACKAGE}
|
||||
|
||||
# Switch to non-root user
|
||||
USER ${AUTH_USER}
|
||||
WORKDIR ${AUTH_HOME}
|
||||
|
||||
# Initialize auth
|
||||
RUN allianceauth start myauth
|
||||
COPY /allianceauth/project_template/project_name/settings/local.py ${AUTH_HOME}/myauth/myauth/settings/local.py
|
||||
RUN allianceauth update myauth
|
||||
RUN mkdir -p ${STATIC_BASE}/myauth/static
|
||||
COPY /docker/conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN echo 'alias auth="python $AUTH_HOME/myauth/manage.py"' >> ~/.bashrc && \
|
||||
echo 'alias supervisord="supervisord -c /etc/supervisor/conf.d/supervisord.conf"' >> ~/.bashrc && \
|
||||
source ~/.bashrc
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
ENTRYPOINT ["sh", "-c"]
|
||||
|
||||
Reference in New Issue
Block a user