Skip to content
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
1 change: 0 additions & 1 deletion Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions dev_test/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
33 changes: 33 additions & 0 deletions dev_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
19 changes: 19 additions & 0 deletions dev_test/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
10 changes: 10 additions & 0 deletions dev_test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

FROM openjdk:17-jdk-alpine

WORKDIR /app

COPY target/devtest-0.0.1.jar /app/devtest-0.0.1.jar

EXPOSE 3000

CMD ["java", "-jar", "/app/devtest-0.0.1.jar"]
4 changes: 2 additions & 2 deletions README.md → dev_test/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ Execute os seguintes comandos para testar a aplicação:
npm test
```

## 6º Passo: Crie um fork desse repositório e submita o código preenchido nele.
Crie um Pull Request para a brach master nos enviando o código
## 6º Passo: Crie um fork desse repositório e submeta o código preenchido nele.
Crie um Pull Request para a brach master nos enviando o código.
19 changes: 19 additions & 0 deletions dev_test/V001__init.sql/V001__init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
create table user (
id int not null auto_increment,
first_name varchar(100) not null,
last_name varchar(100) not null,
email varchar(100) not null,

primary key (id)
) engine=InnoDB default charset=utf8;

create table post (
id int not null auto_increment,
title varchar(100) not null,
description varchar(100) not null,
user_id int not null,

primary key (id)
) engine=InnoDB default charset=utf8;

alter table post add foreign key(user_id) references user(id);
4 changes: 2 additions & 2 deletions docker-compose.yml → dev_test/compose
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
api:
build: .
ports:
- "3000:3000"
- "8080:8080"
environment:
- DB_HOST=db
- DB_USER=root
Expand All @@ -23,7 +23,7 @@ services:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./V001init.sql:/docker-entrypoint-initdb.d/V001init.sql

volumes:
mysql-data:
29 changes: 29 additions & 0 deletions dev_test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
api:
build: .
ports:
- "3000:3000"
restart: always
environment:
- DB_HOST=db
- DB_USER=root
- DB_PASSWORD=password
- DB_NAME=test_db
depends_on:
- db

db:
image: mysql:8.0
restart: always
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=test_db
ports:
- "3308:3306"

volumes:
- db-data:/var/lib/mysql
- ./V001__init.sql:/docker-entrypoint-initdb.d/V001__init.sql:ro

volumes:
db-data:
10 changes: 10 additions & 0 deletions dev_test/filedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

FROM openjdk:17-jdk-alpine

WORKDIR /app

COPY target/my-spring-boot-app.jar /app/my-spring-boot-app.jar

EXPOSE 8080

CMD ["java", "-jar", "/app/my-spring-boot-app.jar"]
Loading