diff --git a/README.md b/README.md index 638245c..f3552f3 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,14 @@ services: ports: - 127.0.0.1:2300:1222 volumes: + - .:/app:ro - ./docker/keys:/keys depends_on: postgres: condition: service_healthy ENDFILE + +cat config/db.sql| docker compose exec -T postgres psql -U acc accounts + +curl -s http://127.0.0.1:2300/ -H "Content-Type: application/json" -d "{\"username\":\"root@root.fr\",\"password\":\"root\"}" | jq -r '.token' ``` \ No newline at end of file diff --git a/config/db.sql b/config/db.sql new file mode 100644 index 0000000..591d4d8 --- /dev/null +++ b/config/db.sql @@ -0,0 +1,7 @@ +CREATE TABLE users ( + username TEXT PRIMARY KEY, + email TEXT UNIQUE NOT NULL, + password TEXT NOT NULL +); + +INSERT INTO users(username, email, password) VALUES('0000000023', 'root@root.fr', '$2a$14$FU8FKR7pUq4akLThraD9kOu0zY0BuUFASo0xakgWEWbYF2gz20DuG'); \ No newline at end of file