Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water Service Test - Isabela Rosa #114

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
node_modules
.tool-versions
README.md
src/db.test.ts
docker-compose.yml
init.sql
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.tool-versions
dist
13 changes: 12 additions & 1 deletion Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
#TODO Configure o Dockerfile
FROM node:20.18.0-alpine

WORKDIR /usr/src/app

COPY . .
RUN npm install

RUN npm run build

EXPOSE 3000

CMD ["node dist/index.js"]
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified docker-compose.yml
100644 → 100755
Empty file.
17 changes: 15 additions & 2 deletions init.sql
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
CREATE DATABASE test_db;

USE test_db;

--TODO Crie a tabela de user;
CREATE TABLE user (
id INT PRIMARY KEY AUTO_INCREMENT,
firstName VARCHAR(100) NOT NULL,
lastName VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
);

--TODO Crie a tabela de posts;
CREATE TABLE post (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(100) NOT NULL,
description VARCHAR(100) NOT NULL,
userId INT NOT NULL,
FOREIGN KEY (userId) REFERENCES user(id)
);
10 changes: 10 additions & 0 deletions ormconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "password",
"database": "test_db",
"entities": ["./src/entity/*.ts"],
"synchronize": true
}
Loading