Skip to content

Commit

Permalink
Merge pull request #1 from franklaercio/test-unit-integrate
Browse files Browse the repository at this point in the history
Adding code to main
  • Loading branch information
franklaercio authored Feb 19, 2024
2 parents 8d1f473 + 8a8a82a commit 317f17c
Show file tree
Hide file tree
Showing 27 changed files with 1,475 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Arquivos e diretórios relacionados ao Maven
target/
mvnw
.mvn/
mvn/
*.jar

# Arquivos de sistema e temporários
.DS_Store
.idea/
*.iml
*.log
*.log.*
log/
logs/
.vscode/
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,35 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

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

# Eclipse
*.project
*.classpath
*.settings
.metadata

# NetBeans
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

# Gradle
.gradle
/build/

# VS Code
.vscode/

# OS X
.DS_Store

# Maven
target/
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM maven:3.9.5-eclipse-temurin-21 AS build
RUN mkdir /src
COPY . /src
WORKDIR /src
RUN mvn clean install -DskipTests

FROM eclipse-temurin:21.0.1_12-jdk

EXPOSE 8080
ENV TZ="UTC"
RUN mkdir /app
COPY --from=build /src/target/*.jar /app/app.jar
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
16 changes: 16 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.2/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.2/maven-plugin/reference/html/#build-image)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.2.2/reference/htmlsingle/index.html#using.devtools)
* [Spring Reactive Web](https://docs.spring.io/spring-boot/docs/3.2.2/reference/htmlsingle/index.html#web.reactive)

### Guides
The following guides illustrate how to use some features concretely:

* [Building a Reactive RESTful Web Service](https://spring.io/guides/gs/reactive-rest-service/)

14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# rinha-de-backend-2024-q1
# Rinha de Backend 2024 Q1

__Nome__: Frank Laércio

__Tecnologias__:
- Java
- Spring WebFlux
- PostgreSQL
- NGINX

__Link Repositório__: https://github.com/franklaercio/rinha-de-backend-2024-q1

__LinkedIn__: https://www.linkedin.com/in/frank-laercio/
69 changes: 69 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: "3.5"

services:
api01: &api
# Lembre-se de que seu serviço HTTP deve estar hospedado num repositório
# publicamente acessível! Ex.: hub.docker.com
build:
context: .
hostname: api01
environment:
- DB_HOSTNAME=db
- POSTGRES_DB=rinha
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=123
ports:
- "8081:8080"
depends_on:
- db
deploy:
resources:
limits:
cpus: "0.35"
memory: "160MB"

api02:
<<: *api
hostname: api02
environment:
- DB_HOSTNAME=db
ports:
- "8082:8080"

nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.2"
memory: "30MB"

db:
image: postgres:latest
hostname: db
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
ports:
- "5432:5432"
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
command: 'postgres -c max_connections=1000 -c work_mem=8MB -c hot_standby=off -c shared_buffers=135MB -c checkpoint_timeout=1d -c wal_level=minimal -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c max_wal_senders=0'
deploy:
resources:
limits:
cpus: "0.7"
memory: "150MB"

networks:
default:
driver: bridge
name: rinha-nginx-2024q1
Loading

0 comments on commit 317f17c

Please sign in to comment.