Skip to content

Commit 06084a2

Browse files
committed
add instructions to BootstrapConfig javadoc
1 parent 1e050f6 commit 06084a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/fairdatapoint/config/BootstrapConfig.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@
3636
import java.util.Arrays;
3737
import java.util.Comparator;
3838

39+
/**
40+
* The {@code BootstrapConfig} class configures a repository populator to load initial data into the relational database, based on JSON fixture files.
41+
* Bootstrapping is disabled by default, and should only be enabled once, on the very first run of the application.
42+
* It can also be enabled on subsequent runs, but then it will overwrite any changes that may have been made by users.
43+
* To enable on the first run, set the env variable {@code BOOTSTRAP_ENABLED=true} on the command line, before running the app.
44+
* When using e.g. docker compose, you can define {@code BOOTSTRAP_ENABLED: ${BOOTSTRAP_ENABLED:-false}} in the {@code environment} section and then set up the stack by running {@code BOOTSTRAP_ENABLED=true docker compose up -d}.
45+
* The default fixtures are located in the {@code <project-root>/fixtures} directory.
46+
* To add custom fixtures and/or override any of the default fixtures in a docker compose setup, we can bind-mount individual fixture files.
47+
* For example: {@code ./my-fixtures/0100_user-accounts.json:/fdp/fixtures/0100_user-accounts.json:ro}
48+
* Note that bind-mounting the entire directory, instead of individual files, would hide all default files.
49+
*/
3950
@Configuration
4051
@Slf4j
4152
public class BootstrapConfig {

0 commit comments

Comments
 (0)