-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# Twitter Backend - Moo: Twitter Clone Application Backend by Scaler
# Copyright © 2021-2026 Subhrodip Mohanta (hello@subho.xyz)
#
# Use Google's Distroless image for Java 21
# This is a minimal, secure, and production-ready runtime.
FROM gcr.io/distroless/java21-debian12:nonroot
LABEL maintainer="Subhrodip Mohanta <hello@subho.xyz>"
LABEL org.opencontainers.image.source="https://github.com/scaleracademy/twitter-backend-java"
WORKDIR /app
# The JAR file must be built before running the docker build.
# This ensures we use the GitHub Actions Maven cache effectively.
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
# Standard Spring Boot port
EXPOSE 8080
# Default environment variables
ENV SPRING_PROFILES_ACTIVE=prod
# Run the application
ENTRYPOINT [ "java", "-jar", "app.jar" ]