Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heyheylibrary
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
Heyheylibrary
Commits
b835875d
Verified
Commit
b835875d
authored
Jul 5, 2024
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Update demo
parent
38432b2f
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
DEMO.md
+32
-1
32 additions, 1 deletion
DEMO.md
Dockerfile.cron.demo
+0
-11
0 additions, 11 deletions
Dockerfile.cron.demo
demo_cronjob
+0
-1
0 additions, 1 deletion
demo_cronjob
docker-compose.demo.yml
+0
-8
0 additions, 8 deletions
docker-compose.demo.yml
with
33 additions
and
21 deletions
.gitignore
+
1
−
0
View file @
b835875d
...
@@ -458,3 +458,4 @@ pyrightconfig.json
...
@@ -458,3 +458,4 @@ pyrightconfig.json
.env.prod
.env.prod
.env.prod.db
.env.prod.db
.env.prod.search
.env.prod.search
demo_media.tar.xz
\ No newline at end of file
This diff is collapsed.
Click to expand it.
DEMO.md
+
32
−
1
View file @
b835875d
...
@@ -16,3 +16,34 @@ There is a `db.demo.sqlite3` file containing demo data. You can use it to test t
...
@@ -16,3 +16,34 @@ There is a `db.demo.sqlite3` file containing demo data. You can use it to test t
-
Email:
`demo2@example.com`
-
Email:
`demo2@example.com`
-
Password:
`DemoUser`
-
Password:
`DemoUser`
-
Card number:
`2222`
-
Card number:
`2222`
## Run Demo
```
bash
git clone https://git.rb9.xyz/TheJoeCoder/heyheylibrary.git
cd
heyheylibrary
cp
db.demo.sqlite3 db.sqlite3
tar
-cJvf
demo_media.tar.xz ./demo_media
docker compose
-f
docker-compose.demo.yml up
-d
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py migrate
--noinput
docker compose
-f
docker-compose.prod.yml
exec
web python manage.py collectstatic
--no-input
--clear
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py opensearch index
--force
create
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py opensearch document
--force
index
```
## Reset Demo
```
bash
# Stop the web container
docker compose
-f
docker-compose.demo.yml stop web
# Reset the database
rm
db.sqlite3
cp
db.demo.sqlite3 db.sqlite3
# Reset the media
rm
-rd
demo_media/
*
tar
-xJvf
demo_media.tar.xz ./demo_media
# Start the web container
docker compose
-f
docker-compose.demo.yml up
-d
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py migrate
--noinput
docker compose
-f
docker-compose.prod.yml
exec
web python manage.py collectstatic
--no-input
--clear
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py opensearch document
--force
delete
docker compose
-f
docker-compose.demo.yml
exec
web python manage.py opensearch document
--force
index
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile.cron.demo
deleted
100644 → 0
+
0
−
11
View file @
38432b2f
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y cron
COPY demo_cronjob /etc/cron.d/cronjob
RUN chmod 0644 /etc/cron.d/cronjob
RUN touch /var/log/cron.log
CMD cron && tail -f /var/log/cron.log
\ No newline at end of file
This diff is collapsed.
Click to expand it.
demo_cronjob
deleted
100644 → 0
+
0
−
1
View file @
38432b2f
0 */3 * * * /usr/bin/cp /home/app/web/db.demo.sqlite3 /home/app/web/db.sqlite3 >> /var/log/cron.log 2>&1
This diff is collapsed.
Click to expand it.
docker-compose.demo.yml
+
0
−
8
View file @
b835875d
...
@@ -52,14 +52,6 @@ services:
...
@@ -52,14 +52,6 @@ services:
networks
:
networks
:
-
librarydemo
-
librarydemo
cron
:
build
:
context
:
.
dockerfile
:
Dockerfile.cron.demo
volumes
:
-
./db.sqlite3:/home/app/web/db.sqlite3
-
./db.demo.sqlite3:/home/app/web/db.demo.sqlite3
volumes
:
volumes
:
demo_static
:
demo_static
:
demo_opensearch
:
demo_opensearch
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment