I am trying to run spring-boot application through docker container. I am using docker-compose for the same. But the container is not getting UP. It's status is showing always 'restarting X seconds'. I'm unable to find the issue because i can't go inside the container to check logs. even 'docker logs' giving any response.
Can anyone let me know if there is any way to find the issue.
below is docker-compose.yml
version: "3"
services:
test-create-backend:
restart: always
build: .
container_name: test-create-backend
environment:
- JASYPT_PWD=${JASYPT_PWD}
networks:
- test-proxy
ports:
- "8096:8096"
volumes:
- /home/ubuntu/tnc_logs:/TnC/logs
nginx:
restart: always
container_name: nginx
image: nginx
networks:
- test-proxy
depends_on:
- test-create-backend
ports:
- '80:80'
- '443:443'
volumes:
- './nginx_proxy/conf.d:/etc/nginx/conf.d:ro'
- './build:/var/www'
- '/etc/ssl/certs:/etc/ssl/certs:ro'
networks:
disip-proxy:
external:
name: test-proxy
below is Dockerfile
FROM maven:3.6.0-jdk-11-slim AS build
# Copy the source code
RUN rm -rf /usr/src/app/*
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
USER root
# Setup working directory
WORKDIR /usr/src/app
# Speed up Maven JVM a bit
ENV MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
# Compile the code, run unit tests and pack the fat-JAR file
RUN mvn -T 1C -f /usr/src/app/pom.xml clean package -DskipTests
# Building the final image with fatjar
FROM openjdk:11-jre-slim
COPY --from=build /usr/src/app/target/test*.jar /home/app/app.jar
ENTRYPOINT java -jar -Dspring.profiles.active=local -Djasypt.encryptor.password=${JASYPT_PWD} /home/app/app.jar