Untitled

mail@pastecode.io avatarunknown
plain_text
2 months ago
328 B
1
Indexable
Never
# Use a Java base image
FROM openjdk:latest

# Set the working directory
WORKDIR /app

# Copy the Java application code into the container
COPY MyApp.java .

# Compile the Java application with Maven
RUN apt-get update && apt-get install -y maven
RUN mvn compile

# Run the Java application
CMD ["java", "MyApp"]