diff --git a/docker/dev-with-prod/docker-compose.yml b/docker/dev-with-prod/docker-compose.yml index db47c48efa..0fbb4064c0 100644 --- a/docker/dev-with-prod/docker-compose.yml +++ b/docker/dev-with-prod/docker-compose.yml @@ -2,34 +2,60 @@ include: - ../docker-compose.yml services: spring: + tty: true container_name: spring build: context: . dockerfile: local-prod.Dockerfile restart: always environment: - SPRING_PROFILES_ACTIVE: staging - LOGGING_LEVEL_ORG_SPRINGFRAMEWORK: debug - SPRING_FLYWAY_LOCATION: classpath:db/migration,classpath:db/data-migration,classpath:db/callback + SPRING_PROFILES_ACTIVE: dev volumes: - ../../../okr/backend/target:/app-root/backend network_mode: "host" + depends_on: + maven-init: + condition: service_completed_successfully maven: + tty: true container_name: maven + restart: on-failure image: maven:3.9.9-amazoncorretto-21 - command: sh -c "mvn fizzed-watcher:run" + command: mvn fizzed-watcher:run working_dir: /app-root/ volumes: - - ../../../okr:/app-root/ + - ../../../okr:/app-root - ~/.m2/repository:/root/.m2/repository + depends_on: + maven-init: + condition: service_completed_successfully + + maven-init: + tty: true + container_name: maven-init + image: maven:3.9.9-amazoncorretto-21 + command: mvn -B clean package -P build-for-docker,debug,no-formatter + working_dir: /app-root/ + volumes: + - ../../../okr:/app-root + - ~/.m2/repository:/root/.m2/repository + depends_on: + angular: + condition: service_healthy angular: container_name: angular image: node:22 - user: "${UID:-1000}:${GID:-1000}" + tty: true + restart: on-failure volumes: - ../../../okr:/opt - - /etc/passwd:/etc/passwd:ro - - /etc/group:/etc/group:ro - command: [ "/bin/bash", "-c", "cd /opt/frontend && npm ci && npm run watch:prod" ] + command: [ "/bin/bash", "-c", "cd /opt/frontend && rm -rf dist && npm ci && npm run watch:prod" ] + healthcheck: + test: bash -c "[ -f /opt/frontend/dist/frontend/index.html ]" + interval: 10s + retries: 999 + start_period: 30s + timeout: 10s + diff --git a/docker/dev-with-prod/local-prod.Dockerfile b/docker/dev-with-prod/local-prod.Dockerfile index 131874545b..a9bfc82e0f 100644 --- a/docker/dev-with-prod/local-prod.Dockerfile +++ b/docker/dev-with-prod/local-prod.Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.20 USER root -RUN apk update && apk add --upgrade curl && apk --no-cache add openjdk17 inotify-tools +RUN apk update && apk add --upgrade curl && apk --no-cache add openjdk21 inotify-tools RUN adduser --home /app-root --uid 1001 --disabled-password okr USER 1001 diff --git a/pom.xml b/pom.xml index 0c521dc5a5..c79a21c2e1 100644 --- a/pom.xml +++ b/pom.xml @@ -127,5 +127,4 @@ -