puzzle / okr

Open source OKR application
GNU Affero General Public License v3.0
12 stars 2 forks source link

Dockerize dev setup #1157

Open kcinay055679 opened 1 week ago

kcinay055679 commented 1 week ago

Is your feature request related to a problem? Please describe. Currently we start every required service by itself, that means everything breaks for every dev on something like a version update.

Describe the solution you'd like A docker setup for dev and a docker setup for integration tests propbably use docker profiles

The bug from #1047 should not occur.

Additional context should look something like this:

spring:
    image: maven:3.9.9-amazoncorretto-17
    container_name: spring
    command: mvn -Dspring-boot.run.profiles=dev spring-boot:run
    restart: always
    ports:
      - "8080:8080"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://okr-dev-db:5432/okr
      SPRING_WEB_RESOURCES_STATIC_LOCATIONS: file:./../okr-logic/src/main/resources/static/
      SPRING_WEB_RESOURCES_CACHE_PERIOD: 0
    working_dir: /app-root/
    volumes:
      - ./../okr-logic:/app-root
      - ~/.m2/repository:/root/.m2/repository

maven:
    container_name: maven
    image: maven:3.9.9-amazoncorretto-21
    command: mvn fizzed-watcher:run
    working_dir: /app-root/
    volumes:
      - ./../okr-logic:/app-root/
      - ~/.m2/repository:/root/.m2/repository

angular:
    container_name: angular
    working_dir: /app-root/
    network_mode: host
    ports:
      - "4200:4200"
    image: node:22
    tty: true
    restart: on-failure
    volumes:
      - ./../okr-view:/app-root/
    command: [ "/bin/bash", "-c", "cd /app-root && npm ci && npm start" ]