Skip to content

Commit

Permalink
Make first time install easier and remove reliance on local npm
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Nov 6, 2024
1 parent c8ac846 commit 77ad489
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.dockerignore
.git
.gitkeep
docker-compose.yml
Dockerfile
README.md
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ __pycache__
db.sqlite3
/static
/node_modules
/app/static/assets
/app/static/assets/*
/app/static/*.css
/app/static/*.css.map
/app/static/*.min.js
/app/static/*.min.js.map
/app/static/*.min.js.map
!.gitkeep
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
```sh
# Build and start the container
docker compose up -d
```

### Add the static assets

# Install Node modules
npm install
During the first time install, your `app/static/assets` directory will be empty.

# Create a static assets directory
mkdir app/static/assets
As you mount the project directory to the `/app` volume, the static assets from TNA Frontend installed inside the container will be "overwritten" by your empty directory.

# Copy in the TNA Frontend static assets
cp -r node_modules/@nationalarchives/frontend/nationalarchives/assets/* app/static/assets
To add back in the static assets, run:

```sh
docker compose exec app cp -r /app/node_modules/@nationalarchives/frontend/nationalarchives/assets /app/app/static
```

### Run tests

```sh
docker compose exec dev poetry run python manage.py test
docker compose exec dev poetry run python /app/manage.py test
```

### Format and lint code
Expand Down
Empty file added app/static/assets/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
- db
volumes:
- ./:/app

db:
image: postgres:latest
environment:
Expand Down

0 comments on commit 77ad489

Please sign in to comment.