update README with detailed docker-compose instructions and improved SQL table creation example
This commit is contained in:
17
README.md
17
README.md
@@ -3,7 +3,7 @@ This is an app which I am currently working on...
|
|||||||
|
|
||||||
## How to run?
|
## How to run?
|
||||||
1. Install docker on your machine
|
1. Install docker on your machine
|
||||||
2. Then run the docker-compose file and make sure that port ```4000``` and ```3306``` are not in use.
|
2. Then run the docker-compose file with ```docker compose up -d``` and make sure that ports ```4000```, ```4001``` and ```3306``` are not in use. Also make sure that you are in the root directory, ```login-page```.
|
||||||
3. Then enter the mysql container (exec) with the credentials that you can see in the ```docker-compose.yml``` file and in the ```.env``` file.
|
3. Then enter the mysql container (exec) with the credentials that you can see in the ```docker-compose.yml``` file and in the ```.env``` file.
|
||||||
4. Then login with the root user with ```mysql -u root -p```, after that enter the password from the ```docker-compose.yml``` file or the ```.env``` file.
|
4. Then login with the root user with ```mysql -u root -p```, after that enter the password from the ```docker-compose.yml``` file or the ```.env``` file.
|
||||||
5. Then type ```use login_page;```
|
5. Then type ```use login_page;```
|
||||||
@@ -26,5 +26,16 @@ VALUES
|
|||||||
('test1', 'John', 'Doe', 'jdoe@example.com', '1test'),
|
('test1', 'John', 'Doe', 'jdoe@example.com', '1test'),
|
||||||
('test2', 'Alice', 'Smith', 'asmith@example.com', '2test');
|
('test2', 'Alice', 'Smith', 'asmith@example.com', '2test');
|
||||||
```
|
```
|
||||||
|
7. For that, just paste this command in the mysql command line:
|
||||||
If you are confident with sql you can change the mock data, and create your own user.
|
``` sql
|
||||||
|
CREATE TABLE users (
|
||||||
|
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
username VARCHAR(50) NOT NULL UNIQUE,
|
||||||
|
first_name VARCHAR(50) NOT NULL,
|
||||||
|
last_name VARCHAR(50) NOT NULL,
|
||||||
|
email VARCHAR(100) NOT NULL UNIQUE,
|
||||||
|
password VARCHAR(255) NOT NULL,
|
||||||
|
created TIMESTAMP NOT NULL DEFAULT NOW()
|
||||||
|
);
|
||||||
|
```
|
||||||
|
8. If you are confident with sql you can change the mock data, and create your own user.
|
Reference in New Issue
Block a user