Skip to content

Commit

Permalink
Added port configuration to deploy on railway
Browse files Browse the repository at this point in the history
  • Loading branch information
LauroSilveira committed Dec 19, 2023
1 parent db779e8 commit d9095cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ RUN mvn clean package -DskipTests

FROM eclipse-temurin:21-jre-alpine
WORKDIR /alura-flix-api
ARG DATABASE_PRO
ARG DATABASE_TEST
ARG JWT_SECRET
COPY --from=build target/*.jar alura-flix-api.jar
EXPOSE 8080

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package com.alura.aluraflixapi.infraestructure.railway;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RailwayConfig {

@Value("server.port")
private String port;
@Bean
String getPort(){
return System.getenv("PORT");
return this.port = System.getenv("PORT");
}
}

0 comments on commit d9095cc

Please sign in to comment.