diff --git a/.gitignore b/.gitignore index dae6077..37b50eb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ .settings .project .classpath +.env +application.properties *.iml .DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0928f9e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:21-jdk-slim + +# Set the working directory +WORKDIR /app + +# Copy the JAR file into the container +COPY target/munera-1.0-SNAPSHOT.jar /app/munera-1.0-SNAPSHOT.jar + +# Expose the port the app runs on +EXPOSE 8080 + +# Run the JAR file +CMD ["java", "-jar", "/app/munera-1.0-SNAPSHOT.jar"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..de975ee --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.8' + +services: + vaadin-app: + image: vaadin-app + build: . + ports: + - "8080:8080" + environment: + SPRING_DATASOURCE_URL: ${DB_ADDRESS} + SPRING_DATASOURCE_USERNAME: ${DB_USER} + SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD} + depends_on: + - db + + db: + image: postgres:13 + environment: + POSTGRES_DB: ${DB_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + ports: + - "5432:5432" diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 06fd252..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1,16 +0,0 @@ -server.port=${PORT:8080} -logging.level.org.atmosphere = warn -spring.mustache.check-template-location = false - -# Launch the default browser when starting the application in development mode -#vaadin.launch-browser=true -# PostgreSQL configuration. -spring.datasource.url = jdbc:postgresql://localhost:5432/munera_vaadin -spring.datasource.username = postgres -spring.datasource.password = -spring.jpa.hibernate.ddl-auto = update -# To improve the performance during development. -# For more information https://vaadin.com/docs/latest/integrations/spring/configuration#special-configuration-parameters -vaadin.allowed-packages = com.vaadin,org.vaadin,dev.hilla,com.application.munera -spring.jpa.defer-datasource-initialization = true -spring.sql.init.mode = always