-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 1002 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 1002 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
28
29
30
31
32
33
# Build only the basicauthentication example
FROM eclipse-temurin:17-jdk
# Set working directory
WORKDIR /app
# Install Maven and Node.js for building
RUN apt-get update && \
apt-get install -y maven curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy only the basicauthentication example files
COPY examples/basicauthentication/pom.xml /app/pom.xml
COPY examples/basicauthentication/src /app/src
COPY examples/basicauthentication/ui.resources /app/ui.resources
# Remove old lock files to avoid npm warnings
RUN rm -f /app/ui.resources/package-lock.json /app/ui.resources/yarn.lock
# Build the Java application (skip frontend build for now)
RUN mvn clean package -DskipTests
# Expose port 8080
EXPOSE 8080
# Set environment variables
ENV JAVA_OPTS="-Xmx512m -Xms256m"
# Run the application
CMD ["java", "-jar", "target/basicauth.war"]