Build web via node docker

This commit is contained in:
Guntis Smaukstelis
2023-12-19 16:06:32 +02:00
parent d08422f929
commit ac8c74fda1
4 changed files with 16 additions and 53 deletions
+1 -17
View File
@@ -1,29 +1,13 @@
# Use a base image with Java and Scala, including SBT
FROM hseeberger/scala-sbt:17.0.2_1.6.2_2.13.8 as build
# Set the working directory
WORKDIR /app
# Copy project files to the Docker image
COPY . /app
# Compile the application
RUN sbt clean assembly
# Use a smaller base image for the final image
FROM amazoncorretto:17-alpine
# Copy the compiled JAR from the build stage
COPY --from=build /app/web/dist/ /web/dist/
COPY --from=build /app/target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar /app.jar
# Define the volume to persist data
VOLUME /data
# Command to run the application
CMD ["java", "-jar", "/app.jar"]
# docker build -t scala-app .
# docker run -v /local/data/path:/data scala-app