-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from rockychen-dpaw/master
Migrate auth2 from oim01 and oim02 to az-aks-prod01
- Loading branch information
Showing
56 changed files
with
4,042 additions
and
1,925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.env* | ||
env* | ||
*-dev.* | ||
*_dev | ||
.coverage | ||
media/ | ||
logs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Prepare the base environment. | ||
FROM python:3.10.12-slim-buster as builder_base_authome | ||
FROM python:3.12.3-slim-bookworm as builder_base_authome | ||
MAINTAINER [email protected] | ||
LABEL org.opencontainers.image.source https://github.com/dbca-wa/authome | ||
RUN apt-get update -y \ | ||
|
@@ -16,12 +16,20 @@ COPY poetry.lock pyproject.toml /app/ | |
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --only main --no-interaction --no-ansi | ||
|
||
#update permissoins | ||
RUN chmod 755 /etc | ||
RUN chmod 555 /etc/bash.bashrc | ||
|
||
#update add user | ||
RUN addgroup -gid 1000 app | ||
RUN adduser -uid 1000 --gid 1000 --no-create-home --disabled-login app | ||
|
||
# Install Python libs from pyproject.toml. | ||
FROM builder_base_authome as python_libs_authome | ||
WORKDIR /app/release | ||
# Install the project. | ||
FROM python_libs_authome | ||
COPY manage.py gunicorn.py testperformance testrequestheaders ./ | ||
COPY manage.py gunicorn.py testperformance testrequestheaders testrediscluster testperformance pyproject.toml ./ | ||
COPY authome ./authome | ||
COPY templates ./templates | ||
RUN export IGNORE_LOADING_ERROR=True ; python manage.py collectstatic --noinput --no-post-process | ||
|
@@ -30,13 +38,13 @@ RUN cp -rf /app/release /app/dev | |
|
||
#comment out logger.debug to improve perfornace in production environment. | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/logger\.debug/#logger.debug/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/from \. import performance/#from . import performance/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/from \.\. import performance/#from .. import performance/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -E -i 's/from\s+\.\s+import\s+performance/#from . import performance/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -E -i 's/from\s+\.\.\s+import\s+performance/#from .. import performance/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/performance\.start_processingstep/#performance.start_processingstep/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/performance\.end_processingstep/#performance.end_processingstep/g' "{}" +; | ||
|
||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/from \.models import DebugLog/#from .models import DebugLog/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/from \.\.models import DebugLog/#from ..models import DebugLog/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -E -i 's/from\s+\.models\s+import\s+DebugLog/#from .models import DebugLog/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -E -i 's/from\s+\.\.models\s+import\s+DebugLog/#from ..models import DebugLog/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/DebugLog\.log/#DebugLog.log/g' "{}" +; | ||
RUN find ./ -type f -iname '*.py' -exec sed -i 's/DebugLog\.attach_request/#DebugLog.attach_request/g' "{}" +; | ||
|
||
|
@@ -65,7 +73,9 @@ fi \n\ | |
|
||
RUN chmod 555 run_command | ||
|
||
RUN chown -R app:app /app | ||
|
||
# Run the application as the www-data user. | ||
USER www-data | ||
USER app | ||
EXPOSE 8080 | ||
CMD ./start_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +0,0 @@ | ||
from django.apps import AppConfig | ||
|
||
class AuthomeConfig(AppConfig): | ||
name = "authome" | ||
verbose_name = "AUTHENTICATION AND AUTHORIZATION" | ||
|
||
default_app_config = 'authome.AuthomeConfig' | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.apps import AppConfig | ||
|
||
class AuthomeConfig(AppConfig): | ||
name = "authome" | ||
verbose_name = "AUTHENTICATION AND AUTHORIZATION" | ||
default = True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.