Patrick Piel
Patrick Piel
RRailway
Created by Patrick Piel on 9/6/2024 in #✋|help
Docker based application cannot be redeployed successfully (502 Gateway Error)
Hello everybody, Since a month we have a issue with one specific service within our production environment. After the first request the deployed instance crashes. The instance is "just" a Java (Spring) application living inside a Docker container. The codebase as the corresponding Dockerfile didn't changed.
FROM maven:3-amazoncorretto-21 AS build
COPY . /home/app
RUN mvn -f /home/app/pom.xml clean package

FROM amazoncorretto:21
COPY --from=build /home/app/bot/target/bot-1.0.0-SNAPSHOT.jar /usr/local/lib/stage.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/local/lib/stage.jar", "--spring.profiles.active=prod"]
FROM maven:3-amazoncorretto-21 AS build
COPY . /home/app
RUN mvn -f /home/app/pom.xml clean package

FROM amazoncorretto:21
COPY --from=build /home/app/bot/target/bot-1.0.0-SNAPSHOT.jar /usr/local/lib/stage.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/local/lib/stage.jar", "--spring.profiles.active=prod"]
The railway.json file:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE"
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE"
}
}
17 replies