Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile base image, Kustomize resources, Django minor version #309

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Prepare the base environment.
FROM python:3.12.6-alpine AS builder_base
FROM python:3.12.8-alpine AS builder_base
LABEL [email protected]
LABEL org.opencontainers.image.source=https://github.com/dbca-wa/resource_tracking

Expand All @@ -26,11 +26,11 @@ RUN apk add --no-cache \
proj \
binutils \
&& ln -s /usr/lib/libproj.so.25 /usr/lib/libproj.so \
&& ln -s /usr/lib/libgdal.so.35 /usr/lib/libgdal.so \
&& ln -s /usr/lib/libgdal.so.36 /usr/lib/libgdal.so \
&& ln -s /usr/lib/libgeos_c.so.1 /usr/lib/libgeos_c.so
WORKDIR /app
COPY poetry.lock pyproject.toml ./
ARG POETRY_VERSION=1.8.3
ARG POETRY_VERSION=1.8.5
RUN pip install --no-cache-dir --root-user-action=ignore poetry==${POETRY_VERSION} \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --only main
Expand Down
10 changes: 5 additions & 5 deletions kustomize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Declarative management of Kubernetes objects using Kustomize.

# How to use
## How to use

Within an overlay directory, create a `.env` file to contain required secret
values in the format KEY=value (i.e. `overlays/uat/.env`). Example:
Expand All @@ -24,8 +24,8 @@ kubectl apply -k overlays/uat --dry-run=client -o yaml
kubectl apply -k overlays/uat
```

# References:
## References

* https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/
* https://github.com/kubernetes-sigs/kustomize
* https://github.com/kubernetes-sigs/kustomize/tree/master/examples
- <https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/>
- <https://github.com/kubernetes-sigs/kustomize>
- <https://github.com/kubernetes-sigs/kustomize/tree/master/examples>
62 changes: 31 additions & 31 deletions kustomize/overlays/prod/cronjobs/harvest-dfes/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_dfes_feed"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: DFES_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_URL
- name: DFES_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_USER
- name: DFES_PASS
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_PASS
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_dfes_feed"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: DFES_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_URL
- name: DFES_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_USER
- name: DFES_PASS
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DFES_PASS
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
69 changes: 38 additions & 31 deletions kustomize/overlays/prod/cronjobs/harvest-email-dplus/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,41 @@ spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "dplus", "--purge-email"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args:
[
"manage.py",
"harvest_tracking_email",
"--device-type",
"dplus",
"--purge-email",
]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
69 changes: 38 additions & 31 deletions kustomize/overlays/prod/cronjobs/harvest-email-iriditrak/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,41 @@ spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "iriditrak", "--purge-email"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args:
[
"manage.py",
"harvest_tracking_email",
"--device-type",
"iriditrak",
"--purge-email",
]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
69 changes: 38 additions & 31 deletions kustomize/overlays/prod/cronjobs/harvest-email-mp70/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,41 @@ spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "mp70", "--purge-email"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args:
[
"manage.py",
"harvest_tracking_email",
"--device-type",
"mp70",
"--purge-email",
]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_ENVIRONMENT
value: "prod"
Loading
Loading