-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
38 lines (27 loc) · 918 Bytes
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
# Frontend build stage
FROM node:18 as frontend-builder
# Set the working directory for the frontend build
WORKDIR /app/frontend
# Copy the frontend project files into the container
COPY frontend/ .
# Install dependencies and build the frontend
RUN npm install
RUN npm run build
# Backend build stage
FROM maven:3.8.5-openjdk-18 as backend-builder
# Copy the entire project into the container
COPY . /app
# Change working directory to the root of the project
WORKDIR /app
# Build the entire project (including backend)
RUN mvn clean package -DskipTests
# Final stage
FROM bellsoft/liberica-openjdk-alpine:18.0.2.1
# Set working directory
WORKDIR /app
# Copy the backend JAR file from the builder stage
COPY --from=backend-builder /app/backend/target/MediaArchivalBackend-0.1.2.jar /app/app.jar
# run the application
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]