# Use a base image with Java installed | |
FROM openjdk:8-jre-alpine | |
# Set the working directory inside the container | |
WORKDIR /app | |
# Copy the HTML file to the container | |
COPY index.html . | |
# Expose port 8080 | |
EXPOSE 8080 | |
# Set the entry point to run the Java HTTP server | |
CMD ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "http-server.jar"] | |
# Copy the Java HTTP server JAR file to the container | |
COPY http-server.jar . | |