Skip to content

Commit ead1bb4

Browse files
committed
Updates README.md with notes on steps to take if sql does not run on startup
1 parent ac34f65 commit ead1bb4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Laravel Tech Test.pdf

-122 KB
Binary file not shown.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,32 @@ LEPP development stack.
2121

2222
This development stack
2323

24+
# .env
25+
26+
You will need to set up a .env file in the root directory for the container to run:
27+
28+
- POSTGRES_DATABASE=app_db
29+
- POSTGRES_USER=username
30+
- POSTGRES_PASSWORD=password
31+
- POSTGRES_ROOT_PASSWORD=rootPassword
32+
33+
The name of the db must remain as `app_db` for the container to work.
34+
35+
# Loading init.SQL
36+
37+
A workaround for cases where the `init.SQL` does not run on startup.
38+
`exec` in to the postgres container, and run the following command:<br /><br />
39+
40+
<code>
41+
<pre>
42+
psql -d app_db -U username -a -f docker-entrypoint-initdb.d/init.sql
43+
</pre>
44+
</code>
45+
46+
This will create and populate all of the database tables.
47+
48+
Note: `app_db` must remain the same, along with the path to `init.sql`, the username is the one you have specified in the `.env` file.
49+
2450
## Usage
2551

2652
Build Laravel file in src folder, or add php files to the "public/" directory. Run `docker-compose up -d --build` at root. Open browser to [http://localhost:8080](http://localhost:8080).

0 commit comments

Comments
 (0)