Skip to content

Commit

Permalink
Created Release 1.0.7 (#100)
Browse files Browse the repository at this point in the history
- Created release 1.0.7
- Fixed docker-compose and docker file
- Now tests are running tih test profile
  • Loading branch information
LauroSilveira authored Feb 10, 2024
1 parent 417175c commit feedb59
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Workflow
name: CI/CD Workflow
run-name: ${{ github.actor }} has started workflow
on:
push:
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM maven:3.9.5-eclipse-temurin-21-alpine AS build
FROM maven:3.9.5-amazoncorretto-17 AS build
COPY . .
RUN mvn clean package -DskipTests

FROM eclipse-temurin:21-jre-alpine
FROM eclipse-temurin:17-jdk
WORKDIR /alura-flix-api
COPY --from=build target/*.jar alura-flix-api.jar
ARG JAR_FILE=target/*.jar
COPY --from=build ${JAR_FILE} alura-flix-api.jar
EXPOSE 8080

ENTRYPOINT ["java", "-jar", "alura-flix-api.jar"]
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ The application is available at:
* [About](#about)
* [Technologies](#Technologies)
* [How to run](#how-to-run)
* [Run with Docker](#run-with-docker-compose)
* [Run with mvn spring-boot:run]()
* [Authentication](#login)
* [Contributors](#contributors)

# About
This is an application with aim to learning about new features of Spring security from Spring version 6.
It is possible to access swagger documentation throught url: [https://alura-flix-api-production.up.railway.app](https://alura-flix-api-production.up.railway.app/swagger-ui/index.html)
It is possible to access swagger documentation through url: [https://alura-flix-api-production.up.railway.app](https://alura-flix-api-production.up.railway.app/swagger-ui/index.html)

The username for test is: guest@aluraflix.com and the password is: 123456, please notice this user has ROLE_USER.

Expand All @@ -23,30 +25,44 @@ The username for test is: guest@aluraflix.com and the password is: 123456, pleas
- Java 17
- Spring boot 3
- Spring 6
- Mongo Atlas
- MongoDB Atlas
- Lombok
- Spring Security
- JWT Token library
- Docker
- Junit, Mockito
- Jacoco Report

# How to Run
<p>Go to the directory docker-compose/docker-compose.yml and execute<p/>
### Run with docker-compose
#### Before run with docker-compose - Necessary set up environments
<p>There's two environments variables tha should be setup:</p>

```yaml
- JWT_SECRET=${JWT_SECRET}
- DATABASE_PRO=${DATABASE_PRO}
```
<p>After that it is possible to run just executing docker-compose.yml this will download the latest version</p>
```shell
docker-compose up
```

### Run with mvn spring-boot
```shell
mvn spring-boot:run
```
#### Login
<p>In the authentication-controller use the credentials<p/>
<p>username: guest@aluraflix.com / password: 123456 to log in.<p/>
<p>In the authentication-controller use the credentials</p>
<p>username: guest@aluraflix.com / password: 123456 to log in.</p>

![login.png](data/login.png)

<p>After that copy the Token JWT<p/>
<p>After that copy the Token JWT</p>

![token-jwt.png](data/token-jwt.png)

<p>And paste it in the Authorize button<p/>
<p>And paste it in the Authorize button</p>

![authorize-token.png](data/authorize-token.png)

Expand All @@ -55,4 +71,4 @@ That's it, you are already logged and can try out all endpoints :wink:
## Contributors
[@LauroSilveira](https://github.com/LauroSilveira)

<p>Fell free to fork and contribute :wink:<p/>
<p>Fell free to fork and contribute :wink:</p>
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3.9'

services:
alura_flix_api:
image: "laurocorreia/alura-flix-api:latest"
Expand All @@ -8,8 +9,8 @@ services:
ports:
- 8080:8080
environment:
DATABASE_PRO: ${DATABASE_PRO}
JWT_SECRET: ${JWT_SECRET}
- JWT_SECRET=${JWT_SECRET}
- DATABASE_PRO=${DATABASE_PRO}
networks:
compose-brigde:
driver: bridge
14 changes: 0 additions & 14 deletions docker-compose/docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.alura</groupId>
<artifactId>alura-flix-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.7-Release</version>
<name>alura-flix-api</name>

<description>An API capable to registry, delete, update and return videos.</description>
Expand Down

0 comments on commit feedb59

Please sign in to comment.