From 98e0b217ad352407af2186995787778a22653476 Mon Sep 17 00:00:00 2001 From: Enrico Costanzi Date: Fri, 17 May 2024 17:30:55 +0200 Subject: [PATCH] add docker and docker compose --- Dockerfile | 14 ++++++++++++++ docker-compose.yml | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..93e1a20 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Use a base image with Java 17 installed +FROM eclipse-temurin:21 + +# Set the working directory inside the container +WORKDIR /app + +# Copy the JAR file into the container +COPY target/twelve-factor-demo.jar my-app.jar + +# Expose the port your application listens on (if applicable) +EXPOSE 8080 + +# Set the command to run your application when the container starts +CMD ["java", "-jar", "my-app.jar"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..50944d0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + 12-factor-demo: + image: intesys/twelve-factor-app-kotlin:latest + environment: + - SERVER_PORT=8080 + - CUSTOM_MESSAGE=Hello World From Docker + ports: + - 8085:8080