Skip to content

Commit

Permalink
DBC22-1804: populate data, serializer, and starting frontend logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrel-oxd committed Mar 11, 2024
1 parent e1ba9bf commit 2ace007
Show file tree
Hide file tree
Showing 123 changed files with 6,484 additions and 542 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ REDIS_PORT=<6379/other port of database server>
# Node
NODE_ENV=<development/test/production>
NODE_OPTIONS=<openssl-legacy-provider>
FONTAWESOME_PACKAGE_TOKEN=<fontawesome package token>

# React
REACT_APP_API_HOST=<localhost:8000/other hostname:port or IP:port of Django server>
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
app=drivebc
containerfiles: ./compose/frontend/StaticBuild
build-args: |
FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
DEBUG_BUILD=true
- name: Push to Github Packages
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
app=drivebc
containerfiles: ./compose/frontend/StaticBuild
build-args: |
FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
DEBUG_BUILD=false
- name: Push to Github Packages
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:
app=drivebc
containerfiles: ./compose/frontend/StaticBuild
build-args: |
DEBUG_BUILD=true
FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
DEBUG_BUILD=false
- name: Push to Github Packages
uses: redhat-actions/push-to-registry@v2.7
Expand Down
2 changes: 2 additions & 0 deletions compose/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN chown node:root /app
# Install dependencies
COPY ./src/frontend/package.json /app/
COPY ./src/frontend/package-lock.json /app/
COPY ./src/frontend/.npmrc /app/
ARG FONTAWESOME_PACKAGE_TOKEN
RUN npm install

# Add rest of the client code
Expand Down
4 changes: 4 additions & 0 deletions compose/frontend/StaticBuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ FROM node:19 AS buildnode
WORKDIR /app/
RUN chown node:root /app

ARG FONTAWESOME_PACKAGE_TOKEN
ENV FONTAWESOME_PACKAGE_TOKEN=${FONTAWESOME_PACKAGE_TOKEN}

# Install dependencies
COPY ./src/frontend/package.json /app/
COPY ./src/frontend/package-lock.json /app/
COPY ./src/frontend/.npmrc /app/
RUN npm install

# Add rest of the client code
Expand Down
14 changes: 14 additions & 0 deletions compose/frontend/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ server {
add_header X-Proxy-Cache $upstream_cache_status;
}

location /django-media/ {
proxy_ssl_server_name on;
proxy_pass http://{ENVIRONMENT}-django;
proxy_connect_timeout 5s;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_age 10s;
proxy_cache_lock_timeout 10s;
proxy_cache_revalidate on;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_valid 200 1d;
add_header X-Proxy-Cache $upstream_cache_status;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:
dockerfile: ./compose/frontend/Dockerfile
args:
DEBUG_BUILD: true
FONTAWESOME_PACKAGE_TOKEN: ${FONTAWESOME_PACKAGE_TOKEN}
stdin_open: true
tty: true
ports:
Expand Down
24 changes: 0 additions & 24 deletions infrastructure/_django/templates/django-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,6 @@ spec:
host: {{ .Values.route.host }}
path: /django-static/

---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "app.fullname" . }}-backend-media
labels: {{ include "app.labels" . | nindent 4 }}
{{ if .Values.route.iprestricted }}
annotations:
haproxy.router.openshift.io/ip_whitelist: {{ .Values.route.ipallowlist }}
{{ end }}
spec:
to:
kind: Service
name: {{ template "app.fullname" . }}
port:
targetPort: 80-tcp
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None
host: {{ .Values.route.host }}
path: /django-media/


---
apiVersion: route.openshift.io/v1
kind: Route
Expand Down
12 changes: 6 additions & 6 deletions infrastructure/main/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ image-caching:
resources:
requests:
cpu: 50m
memory: 50Mi
memory: 100Mi
limits:
cpu: 250m
memory: 100Mi
memory: 150Mi
env:
imagecachingConfigMap: prod-drivebc-image-caching
autoscaling:
Expand All @@ -92,7 +92,7 @@ redis:
cpu: 50m
memory: 50Mi
limits:
cpu: 100m
cpu: 200m
memory: 100Mi

static:
Expand All @@ -106,10 +106,10 @@ static:
resources:
requests:
cpu: 50m
memory: 50Mi
limits:
cpu: 150m
memory: 100Mi
limits:
cpu: 250m
memory: 150Mi
env:
staticConfigMap: prod-drivebc-static
staticSecret: prod-drivebc-static
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/main/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ static:
deployment:
resources:
requests:
cpu: 20m
memory: 50Mi
limits:
cpu: 150m
cpu: 50m
memory: 100Mi
limits:
cpu: 250m
memory: 150Mi
env:
staticConfigMap: test-drivebc-static
staticSecret: test-drivebc-static
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/main/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ image-caching:
resources:
requests:
cpu: 50m
memory: 50Mi
memory: 100Mi
limits:
cpu: 250m
memory: 100Mi
memory: 150Mi
env:
imagecachingConfigMap: uat-drivebc-image-caching
autoscaling:
Expand All @@ -92,7 +92,7 @@ redis:
cpu: 50m
memory: 50Mi
limits:
cpu: 100m
cpu: 200m
memory: 100Mi

static:
Expand Down
Loading

0 comments on commit 2ace007

Please sign in to comment.