File size: 467 Bytes
f09be7e 9cfc9f6 f09be7e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# Final running image
FROM eclipse-temurin:17-jre-alpine
WORKDIR /app
RUN mkdir -p /app
COPY ./*.jar /app/app.jar
# Environment variables
RUN --mount=type=secret,id=MONGO_USERNAME,mode=0444,required=true
RUN --mount=type=secret,id=MONGO_PASSWORD,mode=0444,required=true
RUN --mount=type=secret,id=MONGO_DATABASE,mode=0444,required=true
RUN --mount=type=secret,id=MONGO_AUTH_DB,mode=0444,required=true
# Expose ports
EXPOSE 8080
CMD ["java", "-jar", "app.jar"] |