Skip to content

Commit

Permalink
Add v1 visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-gardener committed Nov 19, 2024
1 parent dd4e1b1 commit b62d371
Show file tree
Hide file tree
Showing 46 changed files with 3,910 additions and 178 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Node deps
FROM node:22.3-slim AS bep-prod-assets
FROM node:23.1-slim AS bep-vite
WORKDIR /app

RUN npm upgrade -g npm \
&& npm upgrade -g yarn \
&& rm -rf /var/lib/apt/lists/*

# build js deps
COPY package.json yarn.lock /app/
COPY bep_vite/package.json bep_vite/yarn.lock /app/
RUN yarn

# run vite build
COPY bep_vite /app
RUN yarn build

FROM bep-vite AS bep-vite-prod
RUN yarn --production \
&& yarn cache clean

# Django app
FROM python:3.12-alpine as bep
FROM python:3.12-alpine AS bep
EXPOSE 80
WORKDIR /app

Expand All @@ -30,7 +37,8 @@ RUN pip install -r requirements.txt --no-cache-dir
COPY . /app

# add prod assets
COPY --from=bep-prod-assets /app/node_modules /app/node_modules
COPY --from=bep-vite-prod /app/dist /static-vite/dist
COPY --from=bep-vite-prod /app/node_modules /app/node_modules

# collect static assets for production
RUN python manage.py collectstatic --noinput
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ about books used in English parishes.
Frontend will be available at `http://localhost:8080/`
Admin Interface will be available at `http://localhost:8080/admin/`

### Install/Switch the admin theme

# Bootstrap
docker exec -it bep_app python manage.py loaddata admin_interface_theme_bootstrap.json

# Django
docker exec -it bep_app python manage.py loaddata admin_interface_theme_django.json

# Foundation
docker exec -it bep_app python manage.py loaddata admin_interface_theme_foundation.json

# U.S. Web Design Standards
docker exec -it bep_app python manage.py loaddata admin_interface_theme_uswds.json

### Create your superuser

docker exec -it bep_app python manage.py createsuperuser
Expand Down Expand Up @@ -78,28 +92,14 @@ Create new migrations

### Yarn (javascript)

First setup an image to build the yarn deps in

docker build -t bep_yarn_helper --target bep-prod-assets .

Then run the following as needed

# add new package
docker run -it --rm -v $(pwd):/app bep_yarn_helper yarn add [package]
docker exec -it bep_vite yarn add [package]

# update a package
docker run -it --rm -v $(pwd):/app bep_yarn_helper yarn upgrade [package]
docker exec -it bep_vite yarn upgrade [package]

# update all packages
docker run -it --rm -v $(pwd):/app bep_yarn_helper yarn upgrade

Note: If you are having problems starting/building the application due to javascript dependencies issues you can also run a standalone node container to help resolve them

docker run -it --rm -v $(pwd):/app -w /app node:22.3 bash

[check Dockerfile for the 'apt-get update' code piece of bep-prod-assets]

yarn ...
docker exec -it bep_vite yarn upgrade

After you update a dependency make sure to rebuild the images

Expand Down
Loading

0 comments on commit b62d371

Please sign in to comment.