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

Chore/yarn docker readme #914

Merged
merged 3 commits into from
Jan 9, 2025
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
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,53 @@ https://paybutton.org
- App will be available at http://localhost:3000.
- Local changes on source code should trigger a reload immediately.

### Yarn docker commands
When developing, there are some commands are meant to be run inside the docker container. To make this process easier, many of them can be run in the host machine with `yarn docker [command]`. Running `yarn docker` will show all of them:

```
Available commands:
shortcut, command name [container_name] command description
---
nr, nextrestart [paybutton-dev] restart the nextJS server
nl, nextlogs [paybutton-dev] see the logs for the nextJS server
db, database [paybutton-db] enter the mariadb command-line using the main db
dbr, databaseroot [paybutton-db] enter the mariadb command-line as root
dbd, databasedump [paybutton-db] dump all db tables as root
dbs, databaseshell [paybutton-db] enter the shell of the mariadb container
dbt, databasetest [paybutton-db] enter the mariadb command-line using the test db
dbu, databaseuser [paybutton-db] enter the mariadb command-line using the users db
t, test [paybutton-dev] run tests
tf, testfull [paybutton-dev] run tests, show full output
tw, testwatch [paybutton-dev] run tests watching it
tc, testcoverage [paybutton-dev] test coverage
ns, nodeshell [paybutton-dev] enter the node container
rns, rootnodeshell [paybutton-dev] enter the node container as root
y, yarn [paybutton-dev] run `yarn` on the node container
ya, yarnadd [paybutton-dev] run `yarn add ARGS` on the node container
yad, yarnadddev [paybutton-dev] run `yarn add -D ARGS` on the node container
yr, yarnremove [paybutton-dev] run `yarn remove ARGS` on the node container
m, migrate [paybutton-dev] run migrations
mm, makemigration [paybutton-dev] create a migration with name ARGS
mr, migratereset [paybutton-dev] recreate the database
pd, prismadb [paybutton-dev] run `prisma db ARGS`
pg, prismagenerate [paybutton-dev] run `prisma generate` to generate client from scheme
c, cache [paybutton-cache] enter the redis command-line interface
cs, cacheshell [paybutton-dev] enter the redis container
cr, cachereset [paybutton-dev] clear the whole redis cache
cmr, cachemainreset [paybutton-dev] clear the main redis cache
cbr, cachebullmqreset [paybutton-dev] clear the bullMQ redis database
jl, jobslogs [paybutton-dev] watch jobs logs
js, jobsstop [paybutton-dev] stop jobs
jr, jobsrestart [paybutton-dev] restart jobs
sl, serverlogs [paybutton-dev] watch WS server logs
ss, serverstop [paybutton-dev] stop WS server
sr, serverrestart [paybutton-dev] restart WS server
```

**WARNING**: Notice this means that many commands are **not supposed** to work by running then purely on the host machine.

For example, `yarn test` runs the `test` script, but this won't work properly when executed from the host machine, so the proper way to execute tests are to run them with `yarn docker test` (or manually entering the `paybutton-dev` container and running `yarn test` there, which is exactly what `yarn docker test` does).


### Optional configuration

Expand Down Expand Up @@ -133,6 +180,22 @@ default: 3000
```
> How long a POST request triggered from a button payment will wait for an answer to be marked as successful.

#### smtpHost
```
type: string
default: N/A
```
> Host name for the server from which payment trigger emails will be sent. Not setting this up will result in email triggers not working.


#### smtpPort
```
type: number
default: N/A
```
> Port for the SMTP server from which payment trigger emails will be sent. Not setting this up will result in email triggers not working.


#### sideshiftAffiliateId
```
type: string
Expand Down
1 change: 1 addition & 0 deletions scripts/docker-exec-shortcuts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ case "$command" in
eval "$base_command_cache" ash -l
;;
*)
# When adding new commands, be sure to add them to this help message below and also update it in the README.
echo Available commands:
echo " shortcut, command name [container_name] command description"
echo " --- "
Expand Down
Loading