Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.git
cdk/
target/
test/
node_modules/
*.md
Expand Down
18 changes: 4 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
# Build: docker build -t moresleep-app:latest .
# Run: docker run --name moresleep-container -p 5000:5000 moresleep-app:latest
# Check localhost:5000 and you should get a homepage
# Stage 1: Build the application
FROM maven:3.9.12-eclipse-temurin-25 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -Dmaven.test.skip=true

# Stage 2: Create the final runtime image
FROM eclipse-temurin:25-jre-jammy AS final
FROM eclipse-temurin:25-jre-jammy
ARG TARGETARCH

# Install unzip and curl
RUN apt-get update -y && \
apt-get install -y curl unzip && \
rm -rf /var/lib/apt/lists/*

# Install SOPS
RUN curl -L -o /usr/local/bin/sops https://github.com/getsops/sops/releases/download/v3.11.0/sops-v3.11.0.linux.amd64 && \
RUN curl -L -o /usr/local/bin/sops https://github.com/getsops/sops/releases/download/v3.11.0/sops-v3.11.0.linux.$TARGETARCH && \
chmod +x /usr/local/bin/sops

# Install AWS CLI v2
Expand All @@ -27,7 +17,7 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/aws
rm -rf /tmp/aws /tmp/awscliv2.zip

WORKDIR /app
COPY --from=build /app/target/cake-redux-jar-with-dependencies.jar app.jar
COPY target/cake-redux-jar-with-dependencies.jar app.jar
COPY ./config/.enc.prod.env /app/.enc.env

# Remove AWS profile from SOPS config to use container's AWS credentials
Expand Down