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
15 changes: 2 additions & 13 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download backend JAR
uses: actions/download-artifact@v4
with:
name: backend-jar
path: backend/target/

- name: Download frontend dist
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: frontend/dist/

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build backend image
uses: docker/build-push-action@v5
with:
context: backend
context: .
file: backend/Dockerfile
push: false
tags: toyswap-backend:${{ github.sha }}
outputs: type=docker,dest=/tmp/backend-image.tar
Expand Down
6 changes: 0 additions & 6 deletions backend/.dockerignore

This file was deleted.

10 changes: 6 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Stage 1: Build (only if JAR not already provided by CI)
FROM eclipse-temurin:17-jdk-alpine AS build
WORKDIR /app
COPY mvnw pom.xml ./
COPY .mvn .mvn
COPY src src
RUN ./mvnw -B package -DskipTests -q
# Copy root parent POM so Maven can resolve it via relativePath (../pom.xml)
COPY pom.xml /pom.xml
COPY backend/mvnw backend/pom.xml ./
COPY backend/.mvn .mvn
COPY backend/src src
RUN --mount=type=cache,target=/root/.m2 ./mvnw -B package -DskipTests -q

# Stage 2: Runtime
FROM eclipse-temurin:17-jre-alpine
Expand Down
9 changes: 9 additions & 0 deletions backend/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
backend/target/
frontend/
serverless/
.git/
**/.idea/
**/*.iml
**/.classpath
**/.project
**/.settings/
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
context: .
dockerfile: backend/Dockerfile
ports:
- "8080:8080"
environment:
Expand Down
Loading