From e5f867694b3a923aa4d2caca0b8132d37d37cdb8 Mon Sep 17 00:00:00 2001 From: Shukhrat Rakhmonov Date: Sun, 12 May 2024 14:10:58 +0500 Subject: [PATCH] Containerize backend and fix Dockerfile --- Dockerfile | 2 +- docker-compose.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5c02112..24040ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,4 @@ COPY --from=builder extracted/application/ ./ EXPOSE 8080 -ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] \ No newline at end of file +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0d6077d..fee357c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,19 @@ version: '3.8' services: + backend: + build: . + image: money-tracker/backend + container_name: backend + ports: + - "8080:8080" + environment: + SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER} + SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD} + SPRING_DATASOURCE_URL: jdbc:postgresql://postgres/${POSTGRES_DB} + depends_on: + - postgres + postgres: image: postgres:15 container_name: postgres