You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER-DOCS.md
+85Lines changed: 85 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ The past development is documented in the [4_IMPLEMENTATION.md](docs/4_IMPLEMENT
16
16
-[Prerequisites](#prerequisites)
17
17
-[Commands for Everyday Development](#commands-for-everyday-development)
18
18
-[Setting Up the Development Environment](#setting-up-the-development-environment)
19
+
-[Seeding Production](#seeding-production)
19
20
-[Usage](#usage)
20
21
-[Accessing the Workspace Container](#accessing-the-workspace-container)
21
22
-[Run Artisan Commands:](#run-artisan-commands)
@@ -123,6 +124,90 @@ npm run dev
123
124
124
125
Open your browser and navigate to [http://localhost](http://localhost).
125
126
127
+
## Seeding Production
128
+
129
+
Seeding production isn't as easy as running `docker compose exec php-fpm php artisan db:seed --force` on the server [as in the Laravel docs](https://laravel.com/docs/12.x/seeding#forcing-seeding-production).
130
+
131
+
That's because neither `fakerphp/faker` (the dev dependency most crucial to seeding) nor `composer` itself is included in the `production` Docker image (see the [docker/deployment/php-fpm/Dockerfile](docker/deployment/php-fpm/Dockerfile) -> only the production dependencies get copied from a previous builder stage to the production stage).
132
+
133
+
Thus, The easiest way to seed production like development here, is exporting the data from the development Postgres database, getting the exported data to the server and importing it there.
134
+
135
+
> **Warning:** Do this production seeding just for demonstration purposes and delete all that data before serious usage.<br>
136
+
> The seeded admin user's credentials are publicly visible in this project's [DatabaseSeeder.php](database/seeders/DatabaseSeeder.php) and all other users have the password `password`.
137
+
138
+
1. Run the waffle-dashboard as described in the [Commands for Everyday Development](#commands-for-everyday-development) section.
139
+
2. Export the data from the two main database tables
8. Delete all data from the `users` and `waffle_eatings` tables (else we'd run into conflicts trying to insert records with already existing `id` values)
0 commit comments